Destructor on a local variable, C/C++ Programming

Should I explicitly call a destructor on a local variable? Explain it.

Posted Date: 2/13/2013 1:39:17 AM | Location : United States





No! 

The destructor will get called again at the close} of the block where the local was created. This is a assurance of the language; it occurs automatically; there''s no way to stop it from happening. But you can get actually bad results from calling a destructor on similar object a second time! Bang! You''re dead!

Posted by Bony | Posted Date: 2/13/2013 1:41:49 AM


Related Discussions:- Destructor on a local variable, Assignment Help, Ask Question on Destructor on a local variable, Get Answer, Expert's Help, Destructor on a local variable Discussions

Write discussion on Destructor on a local variable
Your posts are moderated
Related Questions
decode smugglers are very smart in day by day

1. The shell must support the following internal commands: i. cd - Change the current default directory to . If the argument is not present, report the current directory. If t

A: Use operator overloading to present a friend left-shift operator, operator #include class Fred { public: friend std::ostream& operator ... private: int i_; // onl

Explain about the strategies of implementation of the statecharts, Database Management System?

what is the function of spanning tree in graph algorithm?

Byteland county is very famous for luminous jewels. Luminous jewels are used in making beautiful necklaces. A necklace consists of various luminous jewels of particular colour. Nec

Unions A union is also like a structure, except that only single variable in the union is stored in the allocated memory at a time. It is a collection of mutually exclusive var

Padovan String Problem Description A Padovan string P(n) for a natural number n is defined as: P(0) = ‘X’ P(1) = ‘Y’ P(2) = ‘Z’ P(n) = P(n-2) + P(n-3), n>2 where + denotes s


overloadstream insertion opertator to display the data of object on the console