Answers for "delete 2d dynamic array c++"

C++
2

delete 2d dynamic array c++

for (int i = 0; i < numRows; i++) {
    delete [] world[i];
//    world[i] = 0;  // <- don't have to do this
}
delete [] world;  // <- because they won't exist anymore after this
world = 0;
Posted by: Guest on June-12-2020

Browse Popular Code Answers by Language