Refer base class members from derived class
问题 class A { public: void fa() { } }; class B : public A{ public: void fb() { } }; class C : public A, public B { public: void fc() { //call A::fa(), not B::A::fa(); } }; How to call A::fa() from C::fc() function. GCC warns with direct base A inaccessible in C due to ambiguity , does this mean there is no direct way to refer base class members? 回答1: One option would be to create a stub class that you can use for casting to the right base class subobject: struct A { void fa() { } }; struct B : A