I am not sure if this is documented anywhere. We all know in case of virtual functions, each class holds a vptr which pointer to an array of function pointers called the virtual table. I want to know what is the prototype of the vptr. For ex, if a class is declared as follows,
class A
{
int a;
public: A(){}
virtual void display();
virtual void setValue(int x);
};
Now we are having two function pointer in the vtable of class A. How will a single vptr is capable of two definitions of different prototype?
Please let me know if my understanding is wrong.
Thx! Rahul.
The vptr is an implementation detail, and as such, it does not have a prototype.