Why pragma pack does not work in here? sizeof()
returning the size aligned to 4. I use compiler which comes with Microsoft Visual Studio 2015
#pragma pack(push,1)
struct Header {
uint16_t zero = 0;
uint32_t id{};
};
struct ImageBlock : Header {
uint32_t currentValidLength{};
};
#pragma pack(pop)
constexpr int sz = sizeof(ImageBlock); // returns 12 but should be 10
Tried to also set Struct member alignment (/Zp1)
compiler option with no luck