shikaruki / Hactoberfest2021

Hacktoberfest2021
42 stars 361 forks source link

Create C++ Inheritance #371

Closed shahparam11 closed 1 year ago

shahparam11 commented 1 year ago

In C++, it is possible to inherit attributes and methods from one class to another. We group the "inheritance concept" into two categories:

derived class (child) - the class that inherits from another class base class (parent) - the class being inherited from To inherit from a class, use the : symbol.

In the example below, the Car class (child) inherits the attributes and methods from the Vehicle class (parent)