C++ Programming - Constructors and Destructors - Discussion

Discussion Forum : Constructors and Destructors - General Questions (Q.No. 9)
9.
When are the Global objects destroyed?
When the control comes out of the block in which they are being used.
When the program terminates.
When the control comes out of the function in which they are being used.
As soon as local objects die.
Answer: Option
Explanation:
No answer description is available. Let's discuss.
Discussion:
3 comments Page 1 of 1.

Sagar said:   2 years ago
Because when the global variables having the scope to whole the program and when programs are terminated then global variables space are destroyed.

Niladri S said:   1 decade ago
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.

Akash goyal said:   1 decade ago
Global variable are the scope of the whole programs when programs are triminates than global variables space are destroyed.

Post your comments here:

Your comments will be displayed after verification.