Q:

Should I explicitly call a destructor on a local variable in c++?

0

Should I explicitly call a destructor on a local variable?

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

Answer:

No. Destructor invokes automatically when the local variable is destroyed. But might be you will get bad results from calling a destructor on the same object a second time!.

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

C++ Interview Questions and Answers(2022)

This question belongs to these collections

Similar questions


need a help?


find thousands of online teachers now
How destructors are different from a normal member... >>
<< Is it possible to overload the destructor of the c...