Q:

When is the destructor called in c++?

0

When is the destructor called in c++?

All Answers

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

Answer:

A destructor is called automatically when the object goes out of scope:

  • At the function ends.
  • When the program ends.
  • A block containing local variables ends.
  • When the delete operator is called.

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
Is it possible to overload the destructor of the c... >>
<< What is a destructor in C++?...