What all is inherited from parent class in C++?
Following are the things which a derived class inherits from its parent.
1) Every data member defined in the parent class (although such members may not always be
accessible in the derived class!)
2) Every ordinary member function of the parent class (although such members may not always be
accessible in the derived class!)
3) The same initial data layout as the base class.
Following are the things which a derived class doesn’t inherits from its parent :
1) The base class’s constructors and destructor.
2) The base class’s friends
Recommended Posts:
- Is assignment operator inherited?
- Calculation in parent and child process using fork()
- How to convert a class to another class type in C++?
- Create n-child process from same parent process using fork() in C
- std::any Class in C++
- std:: valarray class in C++
- Array class in C++
- std::string class in C++
- Structure vs class in C++
- std::hash class in C++ STL
- How can we write main as a class in C++?
- How to implement our own Vector Class in C++?
- Virtual base class in C++
- C++ String Class and its Applications | Set 2
- Difference between namespace and class

