How functions are resolved by compiler?
How it is determined whether the below call is bound at compile time or at runtime? object.member_fn;//object is either base class or derived class object p->member_fn;//p is either base class or derived class pointer EDITED: #include <iostream> using namespace std; class Base { public: Base(){ cout<<"Constructor: Base"<<endl;} ~Base(){ cout<<"Destructor : Base"<<endl;} }; class Derived: public Base { //Doing a lot of jobs by extending the functionality public: Derived(){ cout<<"Constructor: Derived"<<endl;} ~Derived(){ cout<<"Destructor : Derived"<<endl;} }; void foo() { Base & Var = Derived(