C++ Constructors Question:
Download Questions PDF

A class's __________ is called when an object is destroyed.

A. constructor
B. destructor
C. assignment function
D. copy constructor

C++ Constructors Interview Question
C++ Constructors Interview Question

Answer:

Option B
destructor

Download C++ Constructors Interview Questions And Answers PDF

Previous QuestionNext Question
For automatic objects, constructors and destructors are called each time the objects

A. enter and leave scope
B. inherit parent class
C. are constructed
D. are destroyed
Destructors __________ for automatic objects if the program terminates with a call to function exit or function abort.

A. are called
B. are inherited
C. are not called
D. are created