#include <stdio.h>
int main()
{
short int i = 20;
char c = 97;
printf("%d, %d, %d\n", sizeof(i), sizeof(c), sizeof(c + i));
return 0;
}
能有一個人告訴我發生什麼事時的sizeof(A + B) 「一短整型& b爲char類型」 輸出爲:2,1,4這裏發生了什麼?的sizeof(short_int_variable + char_variable)
'的sizeof '是一個編譯時構造。 – 2013-05-07 10:00:12
結果大小計算爲int – BLUEPIXY 2013-05-07 10:00:49
您還沒有提到sizeof(c + c)也會給出4,所以sizeof(c/2)或sizeof(1998) – Kartikya 2013-05-07 10:27:20