C++ Programming Code Examples C++ > Beginners Lab Assignments Code Examples How to call overridden function from the child class How to call overridden function from the child class As we have seen above that when we make the call to function (involved in overriding), the child class function (overriding function) gets called. What if you want to call the overridden function by using the object of child class. You can do that by creating the child class object in such a way that the reference of parent class points to it. Lets take an example to understand it. #include <iostream> using namespace std; class BaseClass { public: void disp(){ cout<<"Function of Parent Class"; } }; class DerivedClass: public BaseClass{ public: void disp() { cout<<"Function of Child Class"; } }; int main() { /* Reference of base class pointing to the object of child class. */ BaseClass obj = DerivedClass(); obj.disp(); return 0; }