Skip to content

Commit 9098b9e

Browse files
committed
new page: fopen.md and removed nolink
1 parent 06970bf commit 9098b9e

File tree

2 files changed

+39
-1
lines changed

2 files changed

+39
-1
lines changed

reference/cstdio.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
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) | 書式を指定してファイルから入力する | |

reference/cstdio/fopen.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
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): ??

0 commit comments

Comments
 (0)