[Dev-C++] sizeof returns a wrong value!
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: The_Eu <th...@ig...> - 2005-03-12 21:51:09
|
Hi! =0D
I have a problem with "sizeof"! =0D
look in this struct... =0D
struct Face { =0D
char numVert; ->1 byte =0D
short unsigned int v1,v2,v3,v4; ->4*2 bytes =3D 8bytes =0D
float nx,ny,nz; ->3*4bytes =3D 12bytes =0D
short unsigned int matIndex; ->2bytes =0D
}; =0D
The total is 23Bytes, but sizeof(Face) indicate 28bytes!!! =0D
My declaration "short unsigned int", makes a "int" of 4 bytes, not 2 byte=
s!=20
=0D
=0D
I'm use Dev C++ 4.9.9.2! =0D
Whati is this! =0D
Help!!! |