Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

delete specific row from dynamic 2d array c++

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