永发信息网

fputs()出现错误怎么处理怎么解决

答案:2  悬赏:80  手机版
解决时间 2021-02-08 02:00
  • 提问者网友:皆是孤独
  • 2021-02-07 08:32
fputs()出现错误怎么处理怎么解决
最佳答案
  • 五星知识达人网友:人间朝暮
  • 2021-02-07 09:50
没看懂什么意思?
全部回答
  • 1楼网友:舍身薄凉客
  • 2021-02-07 11:03
fopen("00","w") 注意这里的第二个参数W, 意思是:Opens an empty file for writing. If the given file exists, its contents are destroyed 翻译过来就是:打开一个空文件写,如果指定的文件存在,文件的内容会被摧毁 明白了么? 每次循环都从文件开头写一个字符,重复覆盖.把w改成a就可以了应该 下面是第二个参数的常用VALUE The character string mode specifies the type of access requested for the file, as follows: "r" Opens for reading. If the file does not exist or cannot be found, the fopen call fails. "w" Opens an empty file for writing. If the given file exists, its contents are destroyed. "a" Opens for writing at the end of the file (appending) without removing the EOF marker before writing new data to the file; creates the file first if it doesn’t exist. "r+" Opens for both reading and writing. (The file must exist.) "w+" Opens an empty file for both reading and writing. If the given file exists, its contents are destroyed. "a+" Opens for reading and appending; the appending operation includes the removal of the EOF marker before new data is written to the file and the EOF marker is restored after writing is complete; creates the file first if it doesn’t exist.
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯