SOME_CLASS* class_arr = new SOME_CLASS[4];
I know i can delete the entire pointer's target by
delete class_arr
, but why cant i delete the second element in the pointer's target's array
delete (class_arr+2), for example?
My guess is that this method of allocating the memory will allocate memory consequtively and form a certain continuity between the 4 class objects on the heap, and breaking this contunity between each element is not allowed, but i really have no clue.
Thanks!
and Happy Holidays.

New Topic/Question
Reply



MultiQuote


|