Hello,
I've declared the following class:
Code:
class person
{
public:
int age;
char *name;
person(char *p_name, int p_age);
~person() {
delete[] name;
}
};
In my main program I've declared an array of persons. At the end of my program I'm deleting those objects as following:
Code:
for(i = 0; i < 10; i++) delete persons[i];
Somehow I'm getting the following error:
DAMAGE: after Normal block (#43) at 0x00431AF0.
I'm getting the same error when I'm deleting the name of a person by (without the [])
Can someone tell me what the error means, how I can avoid it and how I can delete the names in the object destructor? (Maybe it isn't necessary at all, but it seems to me, since I'm using a pointer.)