#include <iostream> using namespace std; class oldCompany { public: virtual void marketing () { cout << "How old company does marketing." << endl; } }; class newCompany: public oldCompany { public: virtual void marketing () { cout << "Redefing marketing :D" << endl; } }; int main() { newCompany newish; oldCompany oldish; oldish.marketing (); newish.marketing(); return 0; } /* Output: How old company does marketing. Redefing marketing :D */