Hi all,
I know there are a lot of questions about delete and delete[] but I can't seem to get a straight answer to this.
I create a bunch of objects, lets call them Things:
Thing* thing1 = new Thing();
...
Thing* thing10 = new Thing();
I then create an array of pointers to these things:
Thing** myArray = new Thing*[10];
And then copy the pointers across:
myArray[0] = thing1;
...
myArray[9] = thing10;
Now, if I want to properly clean up "myArray" I assume I call:
delete[] myArray;
But what does this destroy? Is it just the list of pointers or does it destroy all the objects in it too?
i.e. are all the thing1... thing10 pointers still valid after the delete[] call?
Thanks, Gords