I was going though memory alignment section of C FAQs and found:
struct {long; char; short} would have 1 byte of padding after the char, be the same size as example 7, and have no trailing padding.
Why is there padding after char? Why not after short?
I went though this similar question but its still not clear to me. In this one a user mentioned :
it aligns to the largest alignment of any item in the struct
But here largest item in the struct is long
so do we then see next largest alignment while aligning smaller items?
Can someone please help? Thanks!