Inheritance in C++ is one of the major aspects of Object Oriented Programming (OOP). It is the process by which one object can inherit or acquire the features of another object. In C++ class and structure can use inheritance. It means we can make one class (known as derived class) to acquire or inherit the features of another class (known as base class). Base class has general features common to all the derived classes and derived class (apart from having all the features of the base class) adds specific features. This enables us to form a hierarchy of classes. Ex. if we define a class ‘computer’ then it could serve as the base class for defining other classes such as ‘laptops’, ‘desktops’ etc.. This is because as you know that laptops have all the features of computers and so have desktops (and so should their classes) but they have their specific features too. So, rather than defining all the features of such classes...
A resource for learning PHP, HTML, CSS, JavaScript, C++, etc.