Home > Articles > Programming > C/C++

  • Print
  • + Share This
Like this article? We recommend

Like this article? We recommend

Economy in Coding

I want to use inheritance as a means for minimizing the code in derived classes. So, I’ve placed the four data members documentId, documentName, documentType, and associatedNumber in the base class. The values of these variables change depending on the instantiated objects of the derived classes, but they are common across the range of derived classes that we’ll be looking at. Let’s now create some objects derived from the base class.

  • + Share This
  • 🔖 Save To Your Account