对文件输入输出遇到问题
输入1无法停止 求解#include<stdio.h>
main()
{
FILE *fp;
int n;
if((fp=fopen("file1","w"))==NULL)
printf("error\n");
for(;fputc(getchar(),fp)!='1';)
fclose(fp);
if((fp=fopen("file1","r"))==NULL)
printf("error");
for(;!feof(fp);)
printf("%c",fgetc(fp));
fclose(fp);
}