为什么会多得到一个空格
#include<stdio.h>#include<string.h>
#include<stdlib.h>
int main()
{
FILE *fp1,*fp2;
char str1,str2,c;
printf("Please input first file:");
scanf("%s",str1);
if(!(fp1=fopen(str1,"r")))
{
printf("open error!");
exit(0);
}
printf("Please input second filae:");
scanf("%s",str2);
if(!(fp2=fopen(str2,"a")))
{
printf("open error!");
exit(0);
}
while(!feof(fp1))
{
c=fgetc(fp1);
fputc(c,fp2);
}
fclose(fp1);
fclose(fp2);
return 0;
}
页:
[1]