C语言:功能是将文件file1.c的内容输出到屏幕上并复制到文件file2.c中?
#include
void main()
{FILE*in,*out;
char ch;
if(in=fopen("file1.c","r")==NULL)printf("Cannot open this file!);
if(out=fopen("file2.c","w+")==NULL)printf("Write file error!);
while(!feof(in))
{ch=fgetc(in);
fputc(ch,out);
putchar(ch);
}
fclose(out);
fclose(in);
getch();
}