文件复制总是出错!
#include<stdio.h>
main(){
FILE *in,*out;
char ch,infile[10],outfile[10];
printf("Enter the infile name:\n");
scanf("%s",infile);
printf("Enter the outfile name:\n");
scanf("%s",outfile);
printf(infile);
printf(outfile);
if((in=fopen(infile,"r"))==NULL)
{
printf("cannot open infile\n");
exit(0);
}
if((out=fopen(outfile,"w"))==NULL)
{
printf("cannot open outfile\n");
exit(0);
}
while(!feof(in))fputc(fgetc(in),out);
fclose(in);
fclose(out);
}
我想实现两个文件的复制.可它总是提示 cannot open infile ,我输入的文件是存在的.帮找一下错呀,