1. Features that are overloaded with member functions:
The same scope, in the same class
Function name is the same
Different parameters
Virtual keyword is optional
2. Overrides refer to a derived class function overriding a base class function, characterized by:
Different scopes (in the derived and base classes, respectively)
Function name is the same
Same parameters
The base class function must have the virtual keyword
3. Hiding refers to a function of a derived class that masks a base class function with the same name as the following rule:
A. If the function of the derived class has the same name as a function of the base class, the parameters are different. At this point, the functions of the base class are hidden, regardless of the virtual keyword (note not to be confused with overloading)
B. If the function of the derived class has the same name as the function of the base class, and the parameters are the same, the base class function does not have the virtual keyword. At this point, the function of the base class is hidden (note not to be confused with overrides)
This article is from the "Small Stop" blog, please be sure to keep this source http://10541556.blog.51cto.com/10531556/1761849
Overloading of class member functions, overriding and hiding differences