I am having difficulty understanding the purpose of using a destructor function.
If I don't have a destructor function, objects will still be destroyed at the end of a function, and when the program terminates.
For what reason would a destructor function be necessary?