FILE *f1;
FILE *f2;
f1 = fopen ( "/temp/test1.bin" , "rb" );
fseek ( f1 , 0 , SEEK_SET );
f2 = fopen ( "/temp/test2.bin" , "wb" );
fseek ( f2 , 0 , SEEK_SET );
i = 5;
while ((i = fgetc(f1)) != EOF)
{
fputc(i, f2);
}
fclose(f1);
fclose(f2);
Categories: C language
251 Comments