#include #include #include "base.h" #include "derived.h" using namespace std; void f(const base *p); void g(const base& r); int main() { base b(10, 20); derived d(30, 40, 50, 60); f(&b); f(&d); cout << "\n"; g(b); g(d); return EXIT_SUCCESS; } void f(const base *p) { p->print(); cout << "\n"; } void g(const base& r) //same function, but with a reference argument { r.print(); cout << "\n"; }