Here is the program on vtables. Am I understanding is correct on vtables and v-pointers.
Class B
{
public:
virtual Void Hello()
{
cout<<"Hello Base";
}
};
class D: public B
{
public:
virtual void Hello()
{
cout<<"Hello Derived";
}
};
int main(int argc, char* argv[])
{
D *d1 = new D();
D *d2 = new D();
D *d3 = new D();
return 0;
}
In my opinion, there will be two vtables and only one vptr. Am I correct on it?