#include "stdio.h"
main(){
FILE *fp1,*fp2;
char ch;
fp1=fopen("f1.txt","w");
if(fp1==NULL){
printf("\n open the file false1!");
exit(0);
}
while((ch=getchar())!='\n')
fputc(ch,fp1);
rewind(fp1);
fp2=fopen("f2.txt","w");
if(fp2==NULL){
printf("\n open the file false2!");
exit(1);
}
while ((ch=fgetc(fp1))!=EOF)
fputc(ch,fp2);
fclose(fp2);
fclose(fp1);
}
为什么用fgetc得不到fp1中的字符!