I am doing some network programming, and I use some struct
to describe my frame header like that:
struct my_frame_header {
uint16_t field1;
uint16_t field2;
};
And so, when I have a buffer frame I can do something like that:
uint8_t buffer[BUFFER_SIZE];
struct my_frame_header *frame_header = (struct my_frame_header *)buffer;
my_read(buffer, BUFFER_SIZE);
I can now access to the header field like that:
ntohl(frame_header->field1);
Now, my question is: What is the most elegant way to access the data after the structure? (i.e. to get a pointer at the beginning of the data part)