New answers tagged

-1

include void foo() { std::cout << "global foo()" << std::endl; } struct A { void foo() { std::cout << "A::foo()" << std::endl; } }; struct B : public A { void call() { foo(); } }; int main(int argc, char **argv ) { B b; b.call(); return 0; } This gives expected result: A::...


Top 50 recent answers are included