#include <stdio.h>
int main(){
FILE *f = fopen("/tmp/abc.txt","w");
fputs("hello world",f);
fclose(f);
FILE *f2=fopen("/tmp/abc.txt","r");
char s[12];
fgets(s,12,f2);
puts(s);
fclose(f2);
return 0;
}
C语言读取文件
最新推荐文章于 2024-06-17 00:30:00 发布