怎么复制文件内容的同时输出进度百分比? 新手求助
#include<stdio.h>#include<stdlib.h>
void main()
{
FILE *in,*out;
char ch,infile[10],outfile[10];
printf("enter the name of the fileread:");
scanf("%s",infile);
printf("enter the name of the filewrite:");
scanf("%s",outfile);
if((in=fopen(infile,"r"))==NULL)
{
printf("can not open the file!\n");
exit(0);
}
if((out=fopen(outfile,"w"))==NULL)
{
printf("can not open the file!\n");
exit(0);
}
while(!feof(in))
{
ch=fgetc(in);
fputc(ch,out);
putchar(ch);
}
putchar(10);
fclose(in);
fclose(out);
}