Possible Duplicate:
Why isn't sizeof for a struct equal to the sum of sizeof of each member?
I can't understand struct mem alloc.
typedef struct a{
} a;
sizeof(a) is 0
typedef struct b{
int bb
} b;
sizeof(b) is 4
typedef struct b2{
int *bbbb
} b2;
sizeof(b2) is 8
typedef struct d{
int x;
int *y;
} d;
sizeof(d) is 16!
Why sizeof is 16?Is it 12?(int+int point=4+8);
I guess sizeof(int) is 4,if int var in struct,mem is 8?