I have a binary file which contains a header for the size of the whole file and two structures.
{ header (12 bites), struct1, struct2}
I need to delete the struct1 from the file and shift the content of struct2 forward to where struct1 orginally located. After the removal, the file size should be the size of the header + size of struct2
I use memmove, it just COPY struct2 to where struct1 was, however, the content of struct2 still remain where it is. the file looks like (header, struct2, struct2). and the file size remains unchanged.
Can anyone tell me how to move (NOT COPY) the contents of struct2 to struct1?
{ header (12 bites), struct1, struct2}
I need to delete the struct1 from the file and shift the content of struct2 forward to where struct1 orginally located. After the removal, the file size should be the size of the header + size of struct2
I use memmove, it just COPY struct2 to where struct1 was, however, the content of struct2 still remain where it is. the file looks like (header, struct2, struct2). and the file size remains unchanged.
Can anyone tell me how to move (NOT COPY) the contents of struct2 to struct1?