我得到56字節爲以下。誰能解釋這是怎麼回事?如何找到sizeof結構?
#include <stdio.h>
typedef struct how_many_bytes {
long s[4];
char c, e;
int i[2];
char *d;
} How_Many_Bytes;
int main(){
printf("%lu ", sizeof(How_Many_Bytes));
}
不是應該(4 * 8)+ 1 + 1 + 2(用於填充)+ 4 + 4 + 8 = 52字節
很清楚明白。非常感謝。 :) – ivesingh