Is there some difference in the following deletions of object array?
The first way:
MyClass **obj = new MyClass*[NUM];
for (int i=0; i<NUM; i++) obj[i] = new MyClass(val);
obj[0]->method();
for (int i=0; i<NUM; i++) delete obj[i]; /// Deletion1
delete obj; /// Deletion1
The second way:
MyClass **obj = new MyClass*[NUM];
for (int i=0; i<NUM; i++) obj[i] = new MyClass(val);
obj[0]->method();
delete[] obj; /// Deletion2
obj = 0x0; /// Deletion2
Both ways are workable and look similar in debugger.