I understand that the standard doesn't specify padding etc etc, but this is a "real world" question.
I have a struct
and I expect its size to be 18 bytes, since no padding is needed (ints already aligned to 4-bytes boundaries, and chars don't matter).Code:struct S { long long int a; int b; int c; char d; char e; };
But gcc 4.2.3 on x86-64 Linux gives me a size of 24. How does that work?
*edit* is it so that if I stack them up in an array, the long long member will be aligned to 8-bytes boundaries? */edit*



LinkBack URL
About LinkBacks




CornedBee