问题
问答题
C盘中P1.c.txt文件的内容为:abcde。A盘中P1.c.txt为空文档。
#include<stdio.h>
#include<stdlib.h>
main()
FILE *f1,*f2;
int k;
if((fl=fopen("C:\\p1.c.txt","r"))==NULL)
printf("can not open file! \n");
exit(0);
if((f2=fopen("A:\\p1.c.txt","w"))==NULL)
printf("can not open file! \n");
exit(0);
for(k=1;k<=500;k++)
if(feof(f1))break;
fputc(fgetc(f1),f2);
printf("成功实现复制");
fclose(f1);
fclose(f2);
答案
参考答案:成功实现复制