Discussion :: Constructors and Destructors
-
What will be the output of the following program?
#include class GateBase { public: GateBase() { cout"Base OK. "; } virtual ~GateBase() { cout"Base DEL. "; } }; class GateDerived: public BixBase { public: GateDerived() { cout"Derived OK. "; } ~GateDerived() { cout"Derived DEL. "; } }; int main() { GatetBase *basePtr = new GateDerived(); 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 : Option D
Explanation :
No answer description available for this question.
Be The First To Comment

Whatsapp
Facebook