struct AA {
float a;
float b;
unsigned char metadata;
};
struct AA {
float a;
float b;
unsigned char metadata;
};
To copy to clipboard, switch view to plain text mode
The size of this are 4+4+1 , isn't it ?
AA *aa = new AA;
sizeof *aa = 12 ?????
struct AA {
float a;
float b;
float c;
float d;
float e;
short int c1;
short int c2;
};
struct AA {
float a;
float b;
float c;
float d;
float e;
short int c1;
short int c2;
};
To copy to clipboard, switch view to plain text mode
5*4 +4+4 = 28
sizeof *aa = 24 ?????
And I could show more errors .
What is happen ?
I have read something related to pragma option
Y
our compiler may have a "#pragma option" feature that you can use to
wrap your structure definition, to enforce the byte alignment you want.
You have to refer to your documentation for details.
How to do this witn Qt + mingw ?
Thanks
Bookmarks