1. Class base {protected int a;}; class deacted: public base {int b;}. If you change the access restrictions in BASE A, you can use the USING method: use base :: A; 2, if Derive has a member and the member of the member. Includes member functions and only need function names, do not necessarily satisfy similar overload conditions. Still want to manipulate the covered original base. Use classname :: member. 3, a small example:
Class base {public: int A; base () {a = 0;} int Add () {a = a 10; returnif;} print () {Return A;}}; Class Derive: public base {public: INT A; Derive () {a = 100;} change () {a = add ();} print () {Return A;}}; int main ()}}}; int main () {base b; derive d; d.change (); Cout << D.Print () << endl; // result 10 return 0;}
This shows that if the base function in Derive is still only manipulating members in Base. In fact, it is true that it should be considered from a compiler. When Base is generated, it doesn't realize the existence of Derived at all. Small, but very interesting .4, first there is a concept, function signature = function name parameter number parameter order. When the Virtual function is inherited, it must be the same signature. If only the function name is the same, the same name function in the base function will be overwritten, ie the scope will become unavailable. (Small BS, this regulations.)