I need help creating a class destructor. I don't really understand how to create one but I do understand what they do. Since new is called to create users and prizes, I need to write a destructor that calls delete on all the users and prizes.
class User {
public:
string username;
string realname;
int points;
set <string> phone_numbers;
};
class Prize {
public:
string id;
string description;
int points;
int quantity;
};
class CodeProcessor {
~CodeProcessor(); //destructor
protected:
map <string, User *> Names;
map <string, Prize *> Prizes;
}