#include #include #include "derived.h" using namespace std; int main() { derived d {10, 20}; d.print(); //calls the derived::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"; }