Question from the C++ - Fundamentals test

What does the following code return ? class A { public: void f() { cout << "A"; } }; class B { public: void f() { cout << "B"; } }; class C : public A, public B { public: void g() { f(); } }; int main() { C c; c.g(); return 0; }

Easy

What does the following code return ?

class A {
public:
void f() {cout << "A";}
};

class B {
public:
void f() {cout << "B";}
};

class C : public A, public B {
public:
void g() {f();}
};

int main() {
    C c;
    c.g();
    return 0;
}
Author: SamuelStatus: PublishedQuestion passed 73 times
Edit
0
Community EvaluationsNo one has reviewed this question yet, be the first!