|
#include <stdio.h>
|
|
|
|
// 二进制文件复制
|
|
int main()
|
|
{
|
|
FILE *aF = fopen("d12.jpg", "rb");
|
|
if (NULL == aF)
|
|
{
|
|
perror("fopen");
|
|
return 1;
|
|
}
|
|
|
|
FILE *bF = fopen("d12_cpy.jpg", "wb");
|
|
int c;
|
|
while ((c = fgetc(aF)) != EOF)
|
|
{
|
|
fputc(c, bF);
|
|
}
|
|
fclose(aF);
|
|
fclose(bF);
|
|
return 0;
|
|
} |