0
What is the output of the following C++ program?
#include <iostream>
using namespace std;
class P { public: void f() { cout << "P"; } virtual void g() { cout << "P"; } };
class C : public P { public: void f() { cout << "C"; } void g() { cout << "C"; } };
int main() { P *p = new C; p->f(); p->g(); }- APC
- BPP
- CCP
- DCC
Correct answer: A