关于文件的读写操作与内容的写入

#include <stdio.h>
main()
{ FILE *f;
f=fopen("filea.txt","w");
fprintf(f,"abc");
fclose(f);
}


若文本文件filea.txt中原有内容为:hello,则运行以上程序后,文件filea.txt中的内容为

abc

内容为重新写入后的内容

 

原文地址:https://www.cnblogs.com/Mr210843013/p/4804571.html