6
What will be the output of the program?
#include <iostream>
using namespace std;
class A { public: void f() { cout << "A"; } };
class B : public A { public: void f() { cout << "B"; } };
int main() {
B b;
A *p = &b;
p->f();
cout << endl;
return 0;
}DiscussMedium