I\'m currently trying to learn about classes and constructors/destructors. I understand what the two do, but I\'m having a harder time with the destructors because I can\'t
Constructors and Destructors are very important pieces of the RAII (Resource Allocation Is Initialization) idiom. Linking the acquisition of resources (files, memory, sockets, other class objects) to the lifetime of an object is a very powerful tool. When an object goes out of scope, either through normal execution or due to an exception, having the object destructor called allows the class to clean up its resources properly, without having to burden the code using an object with lots of extra finalization steps.