T
thomas
class A{
protected:
int a;
char b;
};
class B: public A{
protected:
char c;
};
class A size is 8 bytes with 3 bytes as alighment padding;
class B size is 12 bytes with another 3 bytes padding.
Why doesn't B pack the two "char" into one 4 bytes?
protected:
int a;
char b;
};
class B: public A{
protected:
char c;
};
class A size is 8 bytes with 3 bytes as alighment padding;
class B size is 12 bytes with another 3 bytes padding.
Why doesn't B pack the two "char" into one 4 bytes?