print?繼承關系圖
繼承關系圖[cpp] <IMG alt="" src="http://img.blog.csdn.net/20130506160720431">
[cpp]
[cpp]
[cpp] class A
{
virtual aa(){};
};
class B : public virtual A
{
char j[3];//加入一個變量是為了看清楚class中的vfptr放在什麼位置
public:
virtual bb(){};
};
class C : public B
{
char i[3];
public:
virtual cc(){};
};
#include <iostream>
using namespace std;
int main()
{
A aa;
int a = sizeof(aa);
B bb;
int b = sizeof(bb);
C cc;
int c = sizeof(cc);
printf("a= %d\nb=%d\nc=%d\n",a,b,c);
return 0;
}