#include <stdio.h>
int main(int argc, const char *argv[])
{
FILE* fp=fopen("./fwrite.c","r");
if(NULL==fp)
{
perror("fopen");
return -1;
}
FILE* fpp=fopen("./mm.c","w");
if(NULL==fpp)
{
perror("fopen");
return -1;
}
char buf[20];
size_t jj;
while(1)
{
jj=fread(buf,1,sizeof (buf),fp);
if(jj==0)
break;
fwrite(buf,1,jj,fpp);
}
return 0;
}
pratice0411:copy file with func fread and func fwrite
最新推荐文章于 2024-08-07 09:14:10 发布