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
1.4m articles
1.4m replys
5 comments
57.0k users