class A1
{
public:
A1()
{
cout << "Inside Constructor A1." << endl;
}
virtual void fA1()
{
cout << "fA1() is called" << endl;
}
};
class B1
{
public:
B1()
{
cout << "Inside Constructor B1." << endl;
}
virtual void fB1()
{
cout << "fB2() is called" << endl;
}
};
class C1: public B1, public A1
{
public:
C1()
{
cout << "Inside Constructor C1" << endl;
}
virtual void fc1()
{
cout << "fc1() is called " << endl;
}
};
cout << "Size of A1 class : " << sizeof(A1) << endl; //Gives 4
cout << "size of B1 Class : " << sizeof(B1) << endl;//4
cout << "size of C1 class : " << sizeof(C1) << endl;//8
why it happens? if vptr of class A and B are inherited into B(size of class C is 8) then, what about vptr of class c ?i.e, size of c should be 16. How the vtable is structured for class c ? is there any possible to see vtable in visual studio.