
- Forum
- Programming Talk
- C and C++
- Function Overriding
Function Overriding
This is a discussion on Function Overriding within the C and C++ forums, part of the Programming Talk category; How is function overriding done? Please provide some examples on how to do it....
-
Function Overriding
How is function overriding done? Please provide some examples on how to do it.
-
In C++ , a function of a class that inherits from multiple base classes or interfaces, can override more than one base class function only if all the base classes or interfaces have a function of the same name and signature. This is the concept of multiple overriding.
-
In addition to multiple overriding in C++ it is also possible for users to carry out explicit overriding of functions. That is a derived class function having the same name and parameters as a base class virtual function will always override it. In C++/CLI you have the option of using the new contextual keyword to specify whether you want to override a base class function or hide it.
-
Sponsored Ads

Reply With Quote





