Gidday,
I'm using CBuilder 6 and I have a class that looks something like this:
Code:
class SHIP
{
public:
virtual AnsiString GetName();
};
I then have classes (Eg: CRUISESHIP, CARGOSHIP) that inherit this and overwrite GetName().
I have then created an array of SHIP's (SHIP * Ships[10]), and when the user creates a new CRUISESHIP or CARGOSHIP it is placed into this array.
This allows me to write:
Code:
CRUISESHIP * Temp = new CRUISESHIP;
/* Do some other stuff */
Ships[0] = Temp;
And there are no problems. The problem is, when I try to delete any of the Ships[], I get an error saying Assert failed and some other stuff.