Should i call a destructor explicitly on a local variable?, C/C++ Programming

Should I call a destructor explicitly on a local variable?

Posted Date: 3/15/2013 5:23:35 AM | Location : United States





Q: Should I call a destructor explicitly on a local variable?

A: No.

The destructor will get called again at close} of the block wherein the local was created. It is a guarantee of the language; it happens automatically; there''s no way to discontinue it from happening. But you can really get bad results from calling a destructor on the same object a second time! Bang! You''re dead!

 

Posted by | Posted Date: 3/15/2013 5:24:06 AM


Related Discussions:- Should i call a destructor explicitly on a local variable?, Assignment Help, Ask Question on Should i call a destructor explicitly on a local variable?, Get Answer, Expert's Help, Should i call a destructor explicitly on a local variable? Discussions

Write discussion on Should i call a destructor explicitly on a local variable?
Your posts are moderated
Related Questions
flow chart for prime or not

pls say code for this above..

Object Initialization An object of a derived class can be initialized to an object of a base class. If both the classes have similar data members, then no specific constructor

Memory management by c program: Write a program to memory management in c program unsigned max( unsigned, unsigned );   int BaseMemBlocks::allocBlock( size_t sz )

smugglers transfer the messages from one to another by using the mobile

Write a program to find the area under the curve y = f(x) between x = a and x = b, integrate y = f(x) between the limits of a and b. The area under a curve between two points can b

Question 1. Explain Briefly about class and objects. 2. Create a class string which stores a string value. Overload ++ operator which converts the characters of the string t


In which condition a template a better solution than a base class? A: While you are designing a generic class to contain or manage objects of other types, while the format & beh

Aim: To implement a program to convert time in 24 hour format to 12 hour format. Code:                       #include #include #include class time24 {