Original Post
i want to change 4 bytes of a file, starting at the 6th byte, leaving the rest of the file intact.
here''s what i tried to do:
FILE *f;
f = fopen(filename, "w+b");
fseek(f, 6, SEEK_SET);
unsigned int v = 1;
fwrite(&v, sizeof(v), 1, f);
fclose(f);
problem: that erases the rest of the file. how do i do it w/o erasing the rest of the file?