How structs in C are saved in the memory?
Why sometimes the struct length in the memory is bigger than expected?
That's called data structure alignment.
Although not a perfect duplicate, you can find a good explanation of this in C at Structure padding and packing
2.1m questions
2.1m answers
60 comments
56.8k users