size of structure# Programming - 葵花宝典
S*t
1 楼
I have a structure defined as:
typedef struct{
char FileCodes[4], U1[4], U2[4], U3[4], U4[4], U5[4], FileLength[4];
int Version, Shape;
double Xmin, Ymin, Xmax, Ymax, Zmin, Zmax, Mmin, Mmax;
}FileHeader;
I used "sizeof(FileHeader)" to get the size of this structure. When I use gcc
in Unix environment, I get 100, which is my expectation. However, when I use
VC in Windows XP, I get 104 all the time. I am really confused about this.
Any help? Thanks.
typedef struct{
char FileCodes[4], U1[4], U2[4], U3[4], U4[4], U5[4], FileLength[4];
int Version, Shape;
double Xmin, Ymin, Xmax, Ymax, Zmin, Zmax, Mmin, Mmax;
}FileHeader;
I used "sizeof(FileHeader)" to get the size of this structure. When I use gcc
in Unix environment, I get 100, which is my expectation. However, when I use
VC in Windows XP, I get 104 all the time. I am really confused about this.
Any help? Thanks.