#include #include #include "base.h" //not necessary, since base.h already included in derived.h #include "derived.h" using namespace std; int main() { derived d {10, 20}; //Calls the derived::print, the print member function of class derived. d.print(); cout << "\n"; //Early binding, a.k.a static binding: //calls base::print, the print member function of class base. //Would be better if it called derived::print. base *p {&d}; p->print(); cout << "\n"; //Early binding, a.k.a static binding: //calls base::print, the print member function of class base. //Would be better if it called derived::print. base& r {d}; r.print(); cout << "\n"; }