#include #include #include "derived.h" using namespace std; int main() { derived d(10, 20, 30, 40); cout << "\n"; d.g(); //Can use any public member of class derived. d.f(); //Can also use any public member of class base. d.print(); //Call the print member function of class derived. cout << "\n"; d.base::print(); //Call the print member function of class base. cout << "\n\n"; const derived *const p = &d; //same examples, but with p-> instead of d. p->print(); //Call the print member function of class derived. cout << "\n"; p->base::print(); //Call the print member function of class base. cout << "\n\n"; return EXIT_SUCCESS; }