forked from cpprefjp/site
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
46 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# close | ||
* fstream[meta header] | ||
* std[meta namespace] | ||
* basic_fstream[meta class] | ||
* function[meta id-type] | ||
|
||
```cpp | ||
void close(); | ||
``` | ||
|
||
## 概要 | ||
|
||
ファイルを閉じる | ||
|
||
## 戻り値 | ||
|
||
[`rdbuf()->close()`](/reference/fstream/basic_filebuf/close.md) | ||
|
||
## 例 | ||
|
||
```cpp example | ||
#include <iostream> | ||
#include <fstream> | ||
|
||
int main() | ||
{ | ||
std::fstream fs("foo"); | ||
fs.close(); | ||
std::cout << std::boolalpha << fs.is_open() << std::endl; | ||
} | ||
``` | ||
* std::fstream[link /reference/fstream/basic_fstream.md] | ||
* std::boolalpha[link /reference/ios/boolalpha.md] | ||
* close()[color ff0000] | ||
|
||
### 出力 | ||
|
||
``` | ||
false | ||
``` | ||
|
||
## バージョン | ||
### 言語 | ||
- C++98 |