-1
對於下面的代碼,我得到了意想不到的結果。使用'sizeof(union.variable)'獲取意外的結果 - >目標C
union
{
int aBuf[RMH_MAX_UNENCODED_LENGTH+sizeof(MSG_INFO)]; //4070+68=4138
}sUnion;
NSLog(@"%d",sizeof(sUnion.aBuf));//printing as 16552 and not 4138
爲什麼這是一個工會呢? – bbum 2011-05-19 04:29:27