源码如下:
#include <stdio.h>
int main(int argc, char* argv[])
{
FILE *op,*inp;
op=fopen("a.png","rb");
inp=fopen("b.png","wb");
void *buf;
char c;
while(!feof(op))
{
//方法二
fread(&buf,1,1,op);
fwrite(&buf,1,1,inp);
//方法二
fread(&c,1,1,op);
fwrite(&c,1,1,inp);
}
fclose(inp);
fclose(op);
printf("over");
return 0;
}
|