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
Introduction. In this assignment you are required to simulate a maze traversal using so called recursive backtracking (the algorithm is given below). The grid of #s and 0s in the f


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 task is to convert S to palindrome

An employee’s total weekly pay equals the hourly wage multiplied by the total number of regular hours plus any overtime pay. Overtime pay equals the total overtime hours multiplied



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

Pebble Merchant Problem Description There is a pebble merchant. He sells the pebbles, that are used for shining the floor. His main duty is to take the length of the room’s sides

A: The simplest instance of a smart pointer is auto_ptr that is included in the standard C++ library. Auto Pointer only takes care of Memory leak & does nothing regarding dangling

What is difference between require_once (), require(), include()? require() includes and evaluates a specific file, if file isn't found then it shows a Fatal Error. require_