天天看點

結構體對齊的方式(自動對齊和手動對齊)

自動對齊不需要加#pragma pack這個宏。

另外,GCC推薦的對齊指令如下:

_attribute_((packed))和_attribute_((aligned(n)))

繼續閱讀