Are only the first 50 MyObject destructors called?
Is the data held in MyObject for the other MyObject's still accessible somewhere or is it lost forever just taking up space at some random spot in memory now?
If I had created a new pointer and pointed it at the 50th spot and then called delete [50]o1;
what happens when I try and access the memory at that pointer?
Are only the first 50 MyObject destructors called?
You could always test it with an output statement in the destructor ;p http://ideone.com/V2nq14 notice how it doesn't compile? delete [50]o1; delete[] is an operator. Are you trying to delete only the first 50 elements?
So only part of the destructors are called, but t2 no longer points to a Test object. Does that mean there is one bool's worth of memory out there that cannot be accessed?
Edit:
Not really trying to actually do anything. More just wondering what exactly happens when delete[] is called.
delete [3]t1 is not a C++ expression, you must have found some sort of Microsoft-only language extension. If so, their documentation should say what it does.
I saw an example in a book about syntax from an earlier form that it warns you might see in "old code". This book was originally published in the mid 90's so maybe that has something to do with it.
Maybe I just miscounted the first time because now calling delete []t2 with any number between the brackets calls the correct number of destructors.