Pointer to Derived Class in C++
The base class pointer can point to both base class & derived class objects. Although, it cannot change the values present in the derived class. Let us see some code examples for the explanation. Code: Output: Code Explanation: In the above code, we have created a class named as Base_Class_Details. Now we created 2 variables …