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
Question 1: (a) Explain clearly the following concepts using suitable examples of your own:- (i) concrete class v/s abstract class (ii) constructor v/s over

Exceptions. Your SVector class should throw four exceptions: 3.1. If the constructor size is invalid, then it will just allow the implicit STL bad_alloc exception to pass up to mai

Draw pie chart in c++ program: int main() {                 char cmd;                   cout                 cout                 cmd = toupper(getch());

A cl a s s c a n b e d e f i n e d i n s i d e a b l o c k o r f u n c t i o n.   T h i s t yp e cla s s i s known

to find prime numbers upto any number say "n" entered by user

Flash my terminal vx670 Project Description: Have VeriFone software need it to communicate with the vx670 through com port 1 it is not talking I'm not sure why have all the r

C program to Print Fibonacci series upto n using recursion: int fibo(long int); void main() {                 long int a=0,n;                 printf ("how many term


Smugglers are becoming very smart day by day. Now they have developed a new technique of sending their messages from one smuggler to another. In their new technology, they are send