Is destructor called when delete is called?

When delete is used to deallocate memory for a C++ class object, the object’s destructor is called before the object’s memory is deallocated (if the object has a destructor). If the operand to the delete operator is a modifiable l-value, its value is undefined after the object is deleted.

Sizin İçin Seçtik  What are C++ destructors?

Leave a Reply

Your email address will not be published. Required fields are marked *