Is there a way to guarantee that a struct is allocated contiguosly in memory?
Here's my problem: I'm reading the header of a binary file into a relatively big structure (~6Kb).
The first 4 members of the structure are:
If I just look at the addresses of these members I see:
signature : 0x9c085c8
version : 0x9c085cc
mode : 0x9c085d0
len : 0x9c085d4
which are definitely not contiguous.
Is there a way to force the struct to be contiguous so I can read it all at once? Or do I have to read each member separately (that would be quite annoying as the struct has more than 300 members...)?
[italic]How beautiful, if Sorrow had not made sorrow more beautiful than Beauty itself.[/italic]