C
- voluntas
- @ignis_fatuus
- ブン
- @Linda_pp
- 清楚なC++メイドBOT
- @tzik_tack
- 長谷川一輝
- wraith13
- @jj1bdx
- @cpp_akira
- 安藤敏彦
- @srz_zumix
- Siv3D
- takezoh
- まろ
- @okdshin
- @hnokx
- @ishidakei
- @take_cheeze
- TAKEI Yuya
- @mumumu
- I (@wx257osn2)
- Tommy6
- @tyottyoworks
- ___shanon
- わたやん
- @KorekaraSEDB
- @kariya_mitsuru
- @ciniml
- @beam2d
- @grafi_tt
- @nekketsuuu
- LouiS0616
- @volanja
- 大鎌広
- むてら
- ガチKGB
- 三重野賢人
x
20
1
2
3
int main(void) {
4
char filename[] = "data.txt";
5
FILE* fp;
6
/* open file */
7
fp = fopen(filename, "rb"); /* "rb" is for binary mode read open */
8
if (fp == NULL) {
9
puts("error");
10
return 1;
11
}
12
/* read file */
13
while (fgetc(fp) >= 0);
14
/* close file */
15
fclose(fp);
16
17
puts("done");
18
return 0;
19
}
20
$ gcc prog.c -Wall -Wextra -std=c89
Start
done
0
Finish