dumb array problem

Started by
11 comments, last by apatequil 20 years, 8 months ago
Slight correction to smitty''s code:

Tile **matrix;//do whatever you do with it...//---Clean it up---//delete stuff each pointer points tofor (int i = 0; i < NUM_OF_ITEMS_IN_MATRIX; i++)   delete [] matrix[i];  //delete the array of Tile objects in memory//        ^^ this is what was added//then delete the actual array of pointersdelete [] matrix;


since each of the elements of matrix is an array then delete [] is needed.
---CyberbrineDreamsSuspected implementation of the Windows idle loop: void idle_loop() { *((char*)rand()) = 0; }
Advertisement
Thank you!
- Moquan
Thank you guys!!!! You''ve been most helpful!!
"Flies are born the size they are" -- Undisclosed Person

This topic is closed to new replies.

Advertisement