A two-dimensional array int g[h][w] is an array of rows, each an array of elements, stored one row after the other: this is row-major order. Element g[i][j] is element of the block of elements.
g[3][4] of Listing 4.7, as written in the source and as stored. The shade marks the row. Walking a row is a stride of 1 in memory; walking a column, a stride of 4.