标签:style code log span char 内存 bsp public virt
class A { char k[3]; public: virtual void a() {}; }; class B : public virtual A { char j[3]; public: virtual void bb() {}; }; class C :public virtual B { char i[3]; public: virtual void cc() {}; };
sizeof(A) = 4+3+1 = 8;
sizeof(B) = sizeof(A)+4+3+1 = 16;
sizeof(C) = sizeof(B)+4+3+1 = 24;
标签:style code log span char 内存 bsp public virt
原文地址:http://www.cnblogs.com/xiuxiu55/p/6493326.html