C's Row-Major: Pointer Arithmetic's Foundation

C's design favors row-major order due to its close ties with pointer arithmetic, where `arr[i][j]` is directly mapped to `*(arr + i * num_cols + j)`. This simplifies memory addressing and makes row-wise access efficient through contiguous memory blocks.

Sources

Open the full topic