Once again, I\'m questioning a longstanding belief.
Until today, I believed that the alignment of the following struct would normally be 4 and the size would normall
One definition of alignment size:
The
alignmentsize of a struct is the offset from one element to the next element when you have an array of that struct.
By its nature, if you have an array of a struct with two elements, then both need to have aligned members, so that means that yes, the size has to be a multiple of the alignment. (I'm not sure if any standard explicitly enforce this, but because the size and alignment of a struct don't depend on whether the struct is alone or inside an array, the same rules apply to both, so it can't really be any other way.)