help with destructors?

Hello!
Trying to create an ATM program with a class "BANK_ACCOUNT".
When the user picks 'close the account', I need the account created through the class to be destroyed.
I'm supposed to do this with a destructor method that sets the balance to zero.
Help?
Destructors can be used only to delete stuff that you want to delete if you allocated them manually.

For example, if you define a pointer in the class scope, and then allocate space (using "new" operator) for it within one of your class's methods (member functions), then a destructor is supposed to have the "delete" operator to delete the data you allocated.

But variables that are not pointers are deleted automatically with the class, when it goes out of scope. Destructors are not necessary for those variables.
Topic archived. No new replies allowed.