Item 21. Overloading and Overriding Are Different
Overloading: Overload Overriding: Override
1. Overloading and Overriding are two different concepts overloading means that there are two or more functions in the same scope to have the same name different signs. The signature of the function includes: the number and type of parameters, and const attributes. When the compiler found that there is more than one function with the same name, it calls one of the matching functions. Overriding is the same as a function of a function that is the name and signature of a virtual function in the parent class. When a sub-class object calls the virtual function, the function of Overriding in the subclass will execute. So Overriding changes the behavior of the class rather than the excuse of the class.
2, egclass b {public: // ... Virtual Int f (int); void f (b *); // ...};
Class D: Public B {public: int F (int); // Overriding b :: f (int) (INT) INT F (b *); // overload D :: f (int), not B: F (b *) (problem in the action)};