I have this
class Empty {}; // Empty class
class Derived : virtual public Empty
{
char c;
};
On my machine, sizeof(Derived);
is 8
, why? Isn't it supposed to be 1
because it only has 1 char
in it?
When I remove the virtual inheritance, sizeof(Derived);
is 1
.