11
What will be the output of the program?
#include <iostream>
using namespace std;
class A {
public:
virtual int g() { return 1; }
int call() { return g(); }
virtual ~A() {}
};
class B : public A { public: int g() override { return 2; } };
int main() {
B b;
cout << b.call() << endl;
return 0;
}Medium