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
#include void func(int num, b=5) { auto int total=0; static int sum=0; for ( int i=num; i>0 ; i--) total+=i; sum+=total; cout

Question 1 Explain the concept of constructors and destructors in C++ with programming examples Question 2 Explain the concepts and applications of multiple inheritance and v

If an array holds integer, each of which is four bytes long, how many bytes from the base location of the array is the location of the fifth element?

in this problem you are given a board in which some of the elements are placed..each element represent ancolor.fill the other elements in the board such that none of the adjacent e

Write a c++ program to find the sum of 0.123 ??103 and 0.456 ??102 and write the result in three significant digits


Ask question #write statement that assign random integer to the varaible n in the (100


Write a ''C'' program to accept any 3 digit integer number from the keyboard and display the word equivalent representation of the given number.

A string S is said to be "Super ASCII", if it contains the character frequency equal to their ascii values. String will contain only lower case alphabets (''a''-''z'') and the asci