Assume we have two base classes, Base1 and Base2, each of which defines a virtual member named print and a virtual destructor. From these base classes we derive the following classes, each of which redefines the print function:
class D1 : public Base1 { /* ... */};class D2 : public Base2 { /* ... */};class MI : public D1, public D2 { /* ... */};Using the following pointers, determine which function is used in each call:
Base1 *pb1 = new MI;Base2 *pb2 = new MI;D1 *pd1 = new MI;D2 *pd2 = new MI;
(a) pb1->print();
(b) pd1->print();
(c) pd2->print();
(d) delete pb2;
(e) delete pd1;
(f) delete pd2;
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.