struct unaming
{
char f;
double dd;
struct
{
int data;
char c;
double d;
};
};
I was expecting the size of this structure to be 40 bytes. But compiler returned 32 bytes. I was expecting the following layout.
[char f][7 bytes][double dd] [int data][4 bytes][char c][7bytes][double d] = 40
This was based on the rule that structures and its member variables will be aligned to the greatest size data type present.
But looks like Compiler re-ordered the unamed structured. Is that the case? Why 32 Bytes?