When is the destructor called in c++?
Answer:
A destructor is called automatically when the object goes out of scope:
total answers (1)
start bookmarking useful questions and collections and save it into your own study-lists, login now to start creating your own collections.
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