C++ Programming Tutorial
Inheritance is the process of inheriting properties of objects of one class by objects of another class. The class which inherits the properties of another class is called Derived or Child or Sub class and the class whose properties are inherited is called Base or Parent or Super class.
Biologically, Inheritance is a term which means acquiring characters of parents by their offspring. Children often seems to have traits that their parents have like similar eye color, style of speaking, walking, etc. Additionally, they have their own traits too.
If more than one functions having same name but differing in terms of number and types of argument it takes is used in a class, it is known as function overloading. It is an example of compile time polymorphism (static/early binding). The compiler determines which function is called during compile time based on the number and types of argument sent.
In C++, private members remain hidden and can only be accessed by other member function of that class and friend function. Friend function is defined or declared using keyword 'friend' before the function prototype inside the class. It takes objects as parameter and access their private members using object name and dot(.) operator. Friend function is used when we need to operate on data of two or more objects of same or different classes. For e.g.
Constructors are the member functions that are executed automatically when an object is created. That means no explicit call is necessary to call a constructor. The name constructor is given because it constructs the value of the data member of class. Constructors are mainly used or initializing data.