I have a struct like this:
class Items
{
private:
struct item
{
unsigned int a, b, c;
};
item* items[MAX_ITEMS];
}
Just to be clear: you refer to calling "delete[]
". I think you mean delete
.
I mention this because C++ has two separate operators, operator delete
and operator delete[]
. The latter is used for deleting arrays of objects allocated with operator new[]
, and does not apply in this case. You have an array of pointers to objects, which you must have initialised with repeated calls to operator new
rather than a single call to operator new[]
.
All I'm really trying to say is: your use of delete[]
is confusing and ambiguous; change it to delete
.