Just rotate the image on the left by 90 degrees, then rows become columns and vice versa.
What you call "row" and "column" in 2D indexing is entirely up to you. In a[i][j], i could be the column and j could be the row, it doesn't matter. It is, however, important to know that in C the last index addresses counts through memory locations.