C++ Function OverridingIf derived class defines same function as defined in its base class, it is known as function overriding in C++. It is used to achieve runtime polymorphism. It enables you to provide specific implementation of the function which is already provided by its base class. C++ Function Overriding ExampleLet's see a simple example of Function overriding in C++. In this example, we are overriding the eat() function. Output: Eating bread... Next TopicC++ Virtual Function |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India