Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

convert 2d array to 1d c++

grid1D[row*col];
grid2D[row][col];

for(int i = 0; i < row; ++i)
    for(int j = 0; j < col; ++j)
          grid1D[i * col + j] = grid2D[i][j];
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #convert #array
ADD COMMENT
Topic
Name
9+9 =