Answers for "c++ convert 2d array to 1d array"

C++
1

array 2d to 1d

int array[width * height];

 int SetElement(int row, int col, int value)
 {
    array[width * row + col] = value;  
 }
Posted by: Guest on January-28-2020

Browse Popular Code Answers by Language