#include <stdio.h>#include <string.h>#include <stdlib.h>int main(){ FILE *fp; int i=7; char *s,m[20]="hello\0";fp=fopen("student.txt","r+");if(fp==NULL){ printf("empty!!"); }else{ printf("file has been open\n") ; fputs("youcan",fp);fprintf(fp,"%d",i); fgets(m,2,fp); printf("%s",m);fclose(fp);} return 0; }这样我运行就没有输出,但是如果我注释掉写入文件的部分,就能正常文件输出
- 4 回答
- 0 关注
- 2441 浏览
添加回答
举报
0/150
提交
取消