C++ Constructors Question:
Download Questions PDF

When are the Global objects destroyed?

A. When the control comes out of the block in which they are being used.
B. When the program terminates.
C. When the control comes out of the function in which they are being used.
D. As soon as local objects die.

Answer:

Option B
When the program terminates.

Download C++ Constructors Interview Questions And Answers PDF

Previous QuestionNext Question
Which of the following statement is incorrect?

A. Constructor is a member function of the class.
B. The compiler always provides a zero argument constructor.
C. It is necessary that a constructor in a class should always be public.
D. Both B and C.
Copy constructor must receive its arguments by __________ .

A. either pass-by-value or pass-by-reference
B. only pass-by-value
C. only pass-by-reference
D. only pass by address