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