Hello all.
I would like to use
#pragma pack(1)
that will make the size of struct be exactly the ones that is declared. Ex:
typedef struct s {
u8 a;
u16 b;
}tStruct;
without #pragma pack(1)
sizeof (tStruct) == 4 (depending on platform?)
with #pragma pack(1)
sizeof (tStruct) == 3
but in windows, QT will assert on the internal checks of QT library complaining about alignment.
I am using QT 5.1.1 MinGW
Any suggestions how can I solve it?
Is there any way to use sizeof to return exactly the size declared of a structure?
Thanks in advance.
MRL
↧