I have a small class that I'd like to be able to write data to. However, whenever I invoke the write function, I receive an error upon deallocation. I know I'm doing something wrong with memory management (because it works fine for my character arrays), but I can't seem to figure out what. I would greatly appreciate any help anyone can give me. Here's the code I'm having problems with:
// set a new date
void Model::setDate(const int newDate)
{ date=newDate; }
// deconstructor
Model::~Model()
{ delete &date; }
// set a new date
void Model::setDate(const int newDate)
{ date=newDate; }
// deconstructor
Model::~Model()
{ delete &date; }