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;
string** new_array = array;
for(int i=0; i<numRows; i++){
new_array = new string[coloumns]
if(i != n){ // <- if you want to delete nth row then
new_array[i] = array[i];
}
}
array = new_array; // <- now array excluding nth row is saved in this pointer.
// let's say we want to dynamically make int[Y][X]:
int** superevil = new int*[Y];
for(int i = 0; i < Y; ++i)
superevil[i] = new int[X];
// now we can do this:
superevil[2][3] = 1;
// but cleanup is just as ugly as allocation:
for(int i = 0; i < Y; ++i)
delete[] superevil[i];
delete[] superevil;