Destructor in C Plus Plus

A destructor is a special member function that is called when the lifetime of an object ends. Destructor's name is defined as the same way as constructor, but with a special character '~' in front. The purpose of the destructor is to free the resources that the object may have acquired during its lifetime.

Click here for Coins/Notes counter with Destructor in C++