Why can\'t we use double pointer to represent two dimensional arrays?
arr[2][5] = {\"hello\",\"hai\"};
**ptr = arr;
Here why doesn\'t the d
Having pointer-to-pointer means that each row (or column, if you prefer to think of it that way) can have a different length from the other rows/columns.
You can also represent a 2D array by just a pointer to the start element, and an integer that specifies the number of elements per row/column:
void matrix_set(double *first, size_t row_size, size_t x, size_t y, double value)
{
first[y * row_size + x] = value;
}