We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
fclose.md
1 parent ec127b7 commit c01cef2Copy full SHA for c01cef2
reference/cstdio/fclose.md
@@ -0,0 +1,37 @@
1
+# fclose
2
+* cstdio[meta header]
3
+* std[meta namespace]
4
+* function[meta id-type]
5
+
6
+```cpp
7
+int fclose(FILE* stream);
8
+```
9
10
+## 概要
11
+ファイルを閉じる。
12
13
+原則、開かれたファイルはプロセスが終了する前にこれを呼び出すことが望ましい。
14
15
+`fclose`によって閉じられたファイルストリームは無効になり、そのファイルストリームに対する以降の操作は未定義動作となる。
16
17
+## 戻り値
18
+正常に実行されれば、`0`を返す。
19
20
+バッファーのフラッシュ時にエラーが発生した場合、もしくはデータの出力時に障害が発生すると`EOF`を返す。
21
22
+それ以外のエラーは処理系依存である。
23
24
+## 例
25
+```cpp example
26
+#include <cstdio>
27
28
+int main() {
29
+ FILE *fp = fopen("test.txt", "w");
30
+ fclose(fp);
31
+}
32
33
34
+## 処理系
35
+- [Clang](/implementation.md#clang): ??
36
+- [GCC](/implementation.md#gcc): ??
37
+- [Visual C++](/implementation.md#visual_cpp): ??
0 commit comments