calculating the size of structure
I was going through the concept of structure member alignment and structure padding concept when I found that the size of this struct ... struct node{ int b; char a; }; ... is 8 bytes (i.e. it contains 3 bytes of padding) whereas the size of this struct ... struct node{ char a; }; ... is only 1 byte. Why is there no padding in the latter? haccks Remember theses two rules for padding: Padding is only inserted when a structure member is followed by a member with a larger alignment requirement or at the end of the structure. The last member is padded with the number of bytes required so that the