#ifndef DERIVED_H #define DERIVED_H #include #include "base.h" //.h file for derived class includes .h file for base class. using namespace std; class derived: public base { //our first class built using inheritance int j; public: derived(int init_i, int init_j) : base {init_i}, j {init_j} { cout << "construct derived\n"; } ~derived() {cout << "destruct derived\n";} void print() const { //The bigger and better print member function... base::print(); //...calls the original print member function. cout << " " << j; } void g() const {cout << "g";} }; #endif