Can you explicitly call a destructor on a local variable?



Can you explicitly call a destructor on a local variable?..

Answer / Mandeep Kumar Srivastava

No, you cannot explicitly call the destructor of a local variable. The destructor is called automatically when the local variable goes out of scope or when it is deleted using delete.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C++ General Interview Questions

Can we make copy constructor private in c++?

1 Answers  


What is & in c++ function?

1 Answers  


Why is c++ a mid-level programming language?

1 Answers  


What is the difference between new() and malloc()?

5 Answers  


Profiler in projects?

2 Answers   Symphony,


How many keywords are used in c++?

1 Answers  


what is the emaning of '#include" "'?

5 Answers  


Array base access faster or pointer base access is faster?

1 Answers  


List the features of oops in c++?

1 Answers  


How can we check whether the contents of two structure variables are same or not?

1 Answers  


Can you explicitly call a destructor on a local variable?

1 Answers  


what is Member Functions in Classes?

1 Answers  


Categories