What is the purpose of a destructor?

Advertisement

  • It allows the programmer to write the necessary code to free the resources acquired by the object prior to deleting the object itself.
  • It deletes an object. One example of a destructor is the delete() function.
  • It terminates a program. This may be achieved as a regular function call or as an exception.
  • There are no destructors in C++.
Join our list

Subscribe to our mailing list and get interesting stuff and updates to your email inbox.

Thank you for subscribing.

Something went wrong.

Leave a Comment


Share via
Join our list

Subscribe to our mailing list and get interesting stuff and updates to your email inbox.

Thank you for subscribing.

Something went wrong.

Send this to a friend