C++ Programming - Constructors and Destructors - Discussion

Discussion :: Constructors and Destructors - General Questions (Q.No.9)


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


No answer description available for this question.

Akash Goyal said: (Aug 27, 2012)  
Global variable are the scope of the whole programs when programs are triminates than global variables space are destroyed.

Niladri S said: (Jul 27, 2013)  
I think @Akash is right. But I would like to expand one thing Global variable has a public visibility label i.e; it is visible to every one whether it is a whole program or between two files. So, when the execution of the program terminates, it is destroyed.

Post your comments here:

Name *:

Email   : (optional)

» Your comments will be displayed only after manual approval.