Data structure alignment: Difference between revisions

Content deleted Content added
Add category
style
Line 158:
</syntaxhighlight>
 
The compiled size of the structure is now 12&nbsp;bytes. It is important to note that the

The last member is padded with the number of bytes required so that the total size of the structure should be a multiple of the largest alignment of any structure member ({{mono|1=alignof(int)}} in this case, which = 4 on linux-32bit/gcc){{Citation needed|reason=see Talk:Data structure alignment (least common multiple requires at least 2 args) and Talk:Data structure alignment (calculation of whole structure alignment and paddings).|date=February 2011}}.
 
In this case 3&nbsp;bytes are added to the last member to pad the structure to the size of 12&nbsp;bytes ({{mono|1=alignof(int) * 3}}).