#include #include #include "base.h" //not necessary, since base.h already included in derived.h #include "derived.h" using namespace std; void make_base(); void make_derived(); /* Construct and destruct a base object. Then construct and destruct a derived object. For clarity, the lifetimes of the two objects do not overlap. */ int main() { make_base(); cout << "\n------------------------No objects exist at this point.\n\n"; make_derived(); return EXIT_SUCCESS; } void make_base() { base b {10}; cout << "The base object contains "; b.print(); cout << " and has a member function named "; b.f(); cout << ".\n"; } void make_derived() { derived d {20, 30}; cout << "The derived object contains "; d.print(); cout << " and has member functions named "; d.f(); cout << " and "; d.g(); cout << ".\n"; }