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
.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.

Node *orderedInsert(Node *p, int newval); /* Allocates a new Node with data value newval and inserts into the ordered list with first node pointer p in such a way that the data va


Prepare a program to obtain prime factors of any integer number using functions

Define Character Input and Output with Files? This is done by using equivalents of putchar and getchar which are called putc and getc. Each one takes an extra argument which id

The size of () operator This is a pseudo-operator given by the language, which returns the number of bytes taken up by a variable or data type. The value returned by this opera

Academic expert for Genetic Algorithm Project Description: Seeking academic expert for Genetic Algorithm. Skills required are Academic Writing, Algorithm, C++ Programming,

how to fill the blank space in4*4 matrix?

WAP TO ACCEPT MARKS OF THREE SUBJECT FOR STUDENT & CALCULATE TOTAL MARKS AND PERCENTAGE #include stdio.h> #include conio.h>   void main() {            int M1,M

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.