Can you compile and run the following code? What will be the output?
#include using namespace std;
class A
{
public :
virtual void f() = 0 ;
};
class B: public A
{
public :
void f()
{
cout << "invoke f from B ” << endl;
}
};
class C: public B
{
public :
virtual void m() = 0 ;
};
class D: public C
{
public :
virtual void m()
{
cout << "invoke m from D " << endl;
}
};
void p(A& a)
{
a.f();
}
int main()
{
D d;
p(d);
d.m();
return 0 ;
}
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.