简体   繁体   中英

C++ #pragma pack

以下陈述实际上做了什么以及它的影响是什么?

#pragma pack(push,8)

It pushes the current pack setting onto a stack (so that you can restore it later via pop ) and then sets the alignment for struct elements to 8 bytes. Anything which is not naturally aligned to an 8 byte boundary will have padding bytes inserted before it to maintain the required alignment.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM