Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

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;
Source by www.cplusplus.com #
 
PREVIOUS NEXT
Tagged: #delete #dynamic #array
ADD COMMENT
Topic
Name
7+9 =