My C++ Quiz

The ultimate place to learn C++!

Question #79: What gets printed by the code below?

01 #include <iostream>
02
03 class A
04 {
05 public:
06    void foo() const { std::cout << "A"; }
07 };
08
09 class B
11 {
12 public:
13    void foo() const { std::cout << "B"; }
14 };
15
16 class C : public A, public B
17 {
18    using A::foo;
19 };
20
21 int main()
22 {
23    C c;
24    c.foo();
25    return 0;
26 }