How are structures in C stored in memory?
Why is sometimes the length of the structure in memory longer than expected?
This is called data structure alignment .
Although this is not an ideal duplicate, you can find a good explanation of this in C on the Deposits and packaging structure .