File tree Expand file tree Collapse file tree 2 files changed +39
-1
lines changed
Expand file tree Collapse file tree 2 files changed +39
-1
lines changed Original file line number Diff line number Diff line change 4444| [ ` tmpfile ` ] ( /reference/cstdio/tmpfile.md ) | 一時ファイルを生成する | |
4545| [ ` tmpnam ` ] ( /reference/cstdio/tmpnam.md ) | 一時ファイル名を生成する | |
4646| [ ` fclose ` ] ( /reference/cstdio/fclose.md ) | ファイルを閉じる | |
47- | [ ` fopen ` ] ( /reference/cstdio/fopen.md.nolink ) | ファイルを開く | |
47+ | [ ` fopen ` ] ( /reference/cstdio/fopen.md ) | ファイルを開く | |
4848| [ ` fflush ` ] ( /reference/cstdio/fflush.md.nolink ) | ファイルをフラッシュする | |
4949| [ ` fprintf ` ] ( /reference/cstdio/fprintf.md ) | 書式を指定してファイルに出力する | |
5050| [ ` fscanf ` ] ( /reference/cstdio/fscanf.md ) | 書式を指定してファイルから入力する | |
Original file line number Diff line number Diff line change 1+ # fopen
2+ * cstdio[ meta header]
3+ * std[ meta namespace]
4+ * function[ meta id-type]
5+
6+ ``` cpp
7+ FILE* fopen (const char* filename, const char* mode);
8+ ```
9+
10+ ## 概要
11+ ファイルを開く。
12+
13+ `mode`にはファイルのモードを指定する。
14+
15+ ## 戻り値
16+ 正常に実行されれば、ファイルストリームを返す。
17+
18+ ファイルの開き方に失敗した場合、`NULL`を返す。
19+
20+ ## 例
21+ ```cpp example
22+ #include <cstdio>
23+
24+ int main() {
25+ FILE *fp = fopen("test.txt", "w");
26+ if (fp == NULL) {
27+ printf("ファイルを開けませんでした\n");
28+ return 1;
29+ }
30+ fclose(fp);
31+ return 0;
32+ }
33+ ```
34+
35+ ## 処理系
36+ - [ Clang] ( /implementation.md#clang ) : ??
37+ - [ GCC] ( /implementation.md#gcc ) : ??
38+ - [ Visual C++] ( /implementation.md#visual_cpp ) : ??
You can’t perform that action at this time.
0 commit comments