谁能告诉我这是为什么?
为什么在“copyfile.txt"文件中会多出一个奇怪的字符,希望大家给予解答!#include <stdio.h>
#include <stdlib.h>
int main()
{
FILE *fp,fp1;
int ch;
if((fp=fopen("file.txt","r"))==NULL)
{
printf("Can't pen the file..");
exit(EXIT_FAILURE);
}
if((fp1=fopen("copyfile.txt","w"))==NULL)
{
printf("Can't pen the file..");
exit(EXIT_FAILURE);
}
while(!feof(fp))
{
ch=fgetc(fp);
fputc(ch,fp1);
}
fclose(fp);
fclose(fp1);
system("pause");
return 0;
}