how to get the index of row while treating 2d array as 1d array code example
Example: array 2d to 1d
int array[width * height];
int SetElement(int row, int col, int value)
{
array[width * row + col] = value;
}
int array[width * height];
int SetElement(int row, int col, int value)
{
array[width * row + col] = value;
}