I have something like this.
char header[4096]; //header information from a file
there is a field called startByteOffset which is 8 bytes (offset in header is 8 too) and then there is endByteOffset which is 8 bytes in lenght too.(offset in header is 16).
I need to change the endByteOffset. How to do that? Thanks.
Let me know if it is not clear enough.
To break an integer into characters (bytes) you can use shifting and masking.
You’ll need to know if the values are to be stored in little-endian or big-endian order. The example I provided above is for little-endian; for big-endian you just reverse the order of the shifts, starting with the largest shift first.