Consider:
struct mystruct_A
{
char a;
int b;
char c;
} x;
struct mystruct_B
{
int b;
char a;
} y;
The sizes of the structur
There are no buts about it! Who want to grasp the subject must do the following ones,
- Peruse The Lost Art of Structure Packing written by Eric S. Raymond
- Glance at Eric's code example
- Last but not least, don't forget the following rule about padding that a struct is aligned to the largest type’s alignment requirements.