10

问答题 10 /69

下面的结构体大小分别是多大(假设32位机器)?
struct A {
char a;
char b;
char c;
};

struct B {
int a;
char b;
short c;
};

struct C {
char b;
int a;
short c;
};

#pragma pack(2)
struct D {
char b;
int a;
short c;
};

参考答案

3,8,12,8