i'm new to C++ and i'm stuck at a very strange looking issue related to virtual functions of derived class.
I have code as below. During execution when putting breakpoint in last statement of main() function, i can see a vptr in (ptr to vtable) in base class obj b1 and same type of vptr in base class under object of derived class (d1) but i'm not able to see another exclusive vptr for derived obj d1 for func1(). Why??
using namespace std;
virtual void get();
virtual void set();
cout << endl << "get() of base";
cout << endl << "set() of base";
class der: public base
void get(); // override virtual base get()
virtual void func1();
cout << endl << "get of der1";
cout<< endl << "func of der";
b1.get(); // vptr suggest base::get() and base::set()
d1.get(); // vptr is present under base part of d1 and suggest der1::get()
d1.func(); // no vptr under d1, but still code executes.