The problem is :there are two files, a.bin of 1024B in size and b.bin of 512B in size,I need copy the b.bin to the top 512B of a.bin and don't change the back 512B.
it seems easy,but i failed,even tried several times.
I open file like this:
the files can be opened successfully,but i finded the a.bin resized to 512B when i read binary from b.bin and writed to a.bin.Code:FILE *fa=fopen("a.bin",wb); FILE *fb=fopen("b.bin","rb");
so i used another way to open a.bin :FILE *fa=fopen("a.bin",ab);
but this time the a.bin changed to 1.5K in size.
what should I do to solve the problems?