// How to use the scope resolution operator to resolve the ambiguity // from a client of class C. #include #include using namespace std; class A { public: int data; int operation(){ cout << "A: operation" << endl; return data; } }; class B { public: int data; int operation(){ cout << "B: operation" << endl; return data; } }; class C: public A, public B{ }; int f(C* c){ int r1 = c->A::operation(), r2 = c->B::operation(); return r1 + r2; } int main(){ f(new C()); // OUTPUT: // A: operation // B: operation }