通过getc和putc函数进行输入和输出
#include"stdio.h"#include"stdlib.h"
main()
{FILE *fpout;
char ch;
if((fpout=fopen("file_a.dat","w"))==NULL)
{printf("Can't open this file!\n");exit(0);}
ch=getchar();
while(ch!='@');
{fputc(ch,fpout);ch=getchar();}
fclose(fpout);
}
输入后为啥文件file_a.dat里字符呢?