I was testing with the size of base classes and derived classes in C++.
class X {};
class Y : public virtual X {};
class Z : public virtual X {};
class A : public Y, public Z {};
The sizeof each X,Y,Z,A came to 1,8,8,12 respectively. I am not able to understand this. I know the default size of an empty class is 1. So I could understand the sizeof X is 1. I know the size of Y and Z will not be as there will be virtual_pointer added to it. But 8? I dont get this. Can somebody explain?