maint i FILE in, out char ch,infile 1ol,outfile 10l 例:文件复制 scanf(%os",infile); scanf(%os",outfile); if(in=fopen (infile, r==NULL) i printf( Cannot open infile.n); exit(O) if ((out=fopen(outfile,W)==NULL) i printf( Cannot open outfile. n; exit(O); while (feof(in)) fputc(fgetc(in), out) fclose(in); fclose(out)main() { FILE *in, *out; char ch,infile[10],outfile[10]; scanf("%s",infile); scanf("%s",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); } 例: 文件复制