|
struct test
{
int xxx[7];
double yyy[4];
};
int main(int argc, char* argv[])
{
test z;
int xxx[7];
double yyy[4];
printf("size of struct : %d\n", sizeof(z));
printf("size of struct.xxx : %d\n", sizeof(z.xxx));
printf("size of struct.yyy : %d\n", sizeof(z.yyy));
printf("size of int 7EA: %d\n", sizeof(xxx));
printf("size of double 4EA: %d\n", sizeof(yyy));
printf("size of int, double %d\n", sizeof(xxx)+sizeof(yyy));
system("pause");
return 0;
}
//---------------------------------------------------------------------------
빌더 6에서 위 소스를 돌려보면 구조체인 z의 사이즈가 64바이트입니다.
그러나 배열 xxx와 yyy의 사이즈를 더하면 60바이트 입니다.
4바이트의 차이는 어디서 생기는 걸까요??
|