1. Home
  2. Computer Science MCQs
  3. C++ and Object-Oriented Programming
  4. In what order are automatic objects of the same block…

Added 30 Nov -0001

In what order are automatic objects of the same block destroyed?

  1. Reverse of their construction order Correct answer
  2. Same as their construction order
  3. In alphabetical order of names
  4. In an order chosen by the linker

Correct answer

A. Reverse of their construction order

18 views

MCQSEXAM

Explanation

Objects are destroyed in the reverse order of construction, exactly like a stack unwinding.

Reference

Asked in: NTS, PPSC IT, Campus Interviews

Preparing for an exam?

Doubts & discussion

Not sure why the answer is A? Ask here and get an explanation.

Ask a doubt about this MCQ

Shown after review. No links please.

More C++ and Object-Oriented Programming MCQs

Practise all C++ and Object-Oriented Programming MCQs

Similar MCQs