Hard
What does the following code display ?
class A {
public:
A() {f();}
virtual void f() {cout << "A";}
};
class B : public A {
public:
void f() {cout << "B";}
};
int main() {
A a;
B b;
A* pa(&b);
pa->f();
return 0;
}
Author: SamuelStatus: PublishedQuestion passed 255 times
Edit
Similar QuestionsMore questions about C++