类的继承会首先寻找基类,若基类未实现,则会寻找派生类的函数 1. class继承,函数不继承 #include class Base { public: Base(){} ~Base(){} int a; void setA() { a = 1; } }; class A:public Base { public: A(){} ~A(){} void setA() { a = 2; } }; class B:public Base { public: B(){} ~B(){} void setA()