I. Overloading
Features that are overloaded by member functions:
(1) The same range (in the same class);
(2) The function has the same name;
(3) different parameters;
(4) The virtual keyword is optional.
Two. Overwrite
Overrides refer to a derived class function overriding a base class function, characterized by:
(1) The range is different (in the derived class and the base class, respectively);
(2) The function name is the same;
(3) the same parameters;
(4) The base class function must have the virtual keyword.
Three. Hide
Hiding means that a derived class function masks a base class function with the same name as the following rule:
(1) If the function of the derived class has the same name as the function of the base class, but the parameters are different. At this point, the function of the base class will be hidden, regardless of the virtual keyword (note not to be confused with overloading);
(2) If the function of the derived class has the same name as the function of the base class, and the parameter is the same, the base class function does not have the Virtua keyword. At this point, the function of the base class is hidden (be careful not to confuse the overlay).
This article is from the "Zwy" blog, make sure to keep this source http://10548195.blog.51cto.com/10538195/1769842
overloading/overwriting/hiding of C + + functions