1.

What will be the output of the following program?

#include<iostream.h>
class BixBase
{ public: BixBase() { cout<< "Base OK. "; } ~BixBase() { cout<< "Base DEL. "; }
};
class BixDerived: public BixBase
{ public: BixDerived() { cout<< "Derived OK. "; } ~BixDerived() { cout<< "Derived DEL. "; }
};
int main()
{ BixBase *basePtr = new BixDerived(); delete basePtr; return 0;
}

A. Base OK. Derived OK.
B. Base OK. Derived OK. Base DEL.
C. Base OK. Derived OK. Derived DEL.
D. Base OK. Derived OK. Derived DEL. Base DEL.
E. Base OK. Derived OK. Base DEL. Derived DEL.
Answer» C. Base OK. Derived OK. Derived DEL.


Discussion

No Comment Found

Related MCQs