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
what is the syntax to get a coloured output.

how yo use the friend function?

Add guts to VS 2008 C++ windows service Project Description: I have a shell windows32 service written in 2008 VS C++. I want the functionality part started. Need someone too

write c++ programm calculate electricity bill with person name,use ,id

Semaphore is used to synchronize processes. whereas mutex is used to give synchronization among threads running in the similar process.

Shell sort - C Program: Write a program to define shell sort. void main() {                  //program for sorting by select sort int a[20],i,k,j,n;   clrscr();

write a program that declares and initializes 2 integer variable a and b with the value 35 and 14, and displays and calculates their sum,product,quotient and real division result.t

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

Problem : Change to palindrome A palindrome is a string that reads the same from both the ends. Given a string S convert it to a palindrome by doing character replacement. Your ta

Aim: To implement a program to find area of rectangle, surface area of box and volume of box using virtual functions. Code:                       class rect {