A destructor is kind of the opposite to a construct. It is responsible for releasing all resources allocated in any other constructor of that class, \eg
A destructor is kind of the opposite to a constructer. It is responsible for releasing all resources allocated in any other constructor of that class, \eg
to free all memory or to close opened files. A destructor is called whenever the life-time of a class end, either at the end of a scope or explicitly via