Original Post
I came across a confusing phenomenon; why is sizeof(myStruct) == 8? struct myStruct { unsigned long numberOne; unsigned short numberTwo; }; If I put the pragmas below around it, the size will be 6, why? When do I need to use this "workaround"? And what does this pragma do? #pragma pack(push, 1) /* ... */ #pragma pack( pop )