I have a class named PolyLine with the following data members:
double *xArray;
double *yArray;
int length;
I have a destructor:
~PolyLine()
{
cout << "I'm destroying you";
delete [] xArray;
delete [] yArray;
}
when I delete a PolyLine:
delete p1;//where p1 is a pointer to a PolyLine
The text "I'm destroying you" is printed but the object can still be printed. Could someone tell me what I am doing wrong ? Thanks