3 ms·
Also, the translation unit compilation model of C would be troublesome here, if optimization settings could influence struct layout. You can't have different tr
by kazinator 10y ago
Also, the translation unit compilation model of C would be troublesome here, if optimization settings could influence struct layout. You can't have different translation units interpreting the same struct type declaration differently.
- maccard 10y ago> You can't have different translation units interpreting the same struct type declaration differently. Sure you can! // MyHeader.h struct MyStruct { int A; char b; int* c; }; // A.cpp #include "MyHeader.h" <...> // B.cpp #pragma pack(push, 16) #include "MyHeader.h" #pragma pack(pop) <...>