C-Sharp | Java | Python | Swift | GO | WPF | Ruby | Scala | F# | JavaScript | SQL | PHP | Angular | HTML
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. #include Output: Eating bread...
Next TopicC++ Virtual Function
|