C++ Programming - Constructors and Destructors

Exercise : Constructors and Destructors - General Questions
31.
A class's __________ is called when an object is destroyed.
constructor
destructor
assignment function
copy constructor
Answer: Option
Explanation:
No answer description is available. Let's discuss.

32.
Destructors __________ for automatic objects if the program terminates with a call to function exit or function abort.
are called
are inherited
are not called
are created
Answer: Option
Explanation:
No answer description is available. Let's discuss.

33.
Which of the following statement is correct?
A constructor of a derived class can access any public and protected member of the base class.
Constructor cannot be inherited but the derived class can call them.
A constructor of a derived class cannot access any public and protected member of the base class.
Both A and B.
Answer: Option
Explanation:
No answer description is available. Let's discuss.

34.
Which of the following statements are correct?
Constructor is always called explicitly.
Constructor is called either implicitly or explicitly, whereas destructor is always called implicitly.
Destructor is always called explicitly.
Constructor and destructor functions are not called at all as they are always inline.
Answer: Option
Explanation:
No answer description is available. Let's discuss.

35.
How many times a constructor is called in the life-time of an object?
Only once
Twice
Thrice
Depends on the way of creation of object
Answer: Option
Explanation:
No answer description is available. Let's discuss.