Hi all,
What is vtable ?
How many vtables created for this sample.

class A
{
     virtual void myFunc() = 0;
};
class B : public A
{
     virtual void myFunc() = 0;
};

class C: pulibc B
{
     void myFunc() 
     {
         cout <<"MyFunc"<<endl;
     }
};

void main(void)
{
     C c;
     c.myFunc();
}

>What is vtable ?
A fancy term for an array of function pointers.

>How many vtables created for this sample.
Maybe none. The virtual mechanism doesn't have to be implemented using the vtable concept. However, if it did, the answer would probably be one, but it's implementation-defined.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.