请教虚继承内存问题!
#include"iostream.h"class A
{};
class B : virtual public A
{};
class C : virtual public A
{};
class D : public B, public C
{};
class E : virtual public B, public C
{};
class F : virtual public B, virtual public C
{};
void main()
{
A a;
B b;
C c;
D d;
E e;
F f;
cout<< sizeof(a) << endl;
cout<< sizeof(b) << endl;
cout<< sizeof(c) << endl;
cout<< sizeof(d) << endl;
cout<< sizeof(e) << endl;
cout<< sizeof(f) << endl;
}
输出结果为:1 4 4 8 8 12 。 请问各位大侠,sizeof(d)与sizeof(e)为什么一样?