- The subclass and parent class return value parameters are the same, the function name is the same, and the virtual keyword is the type of the object that determines which function is called.
- Subclasses and parent classes as long as the function name is the same, without the virtual keyword, the object of the subclass has no way to call a function with the same name as the parent class, the parent class has a function with the same name hidden, or you can force calling the parent class with the same name function Class::funtion_name.
- Subclass and Parent class parameters are different, the function name is the same, there is the virtual keyword, there is no polymorphism, the object of the subclass has no way to call the parent class with the same name function, the parent class has the same name function is hidden, you can also force call the parent class with the same name function Class::funtion_name.
- The subclass and the parent return values are different, the parameters are the same, the function names are the same, there is the virtual keyword, then the compiler error Error C2555 compiler does not allow the function name parameter the same return value different function overloads.
Names of C + + subclasses and parent class member functions