[Solved] If column-major order is used, how is the following matrix stored in memory?

If column-major order is used, how is the following matrix stored in memory?

a b c
d e f
g h I

a) ihgfedcba
b) abcdefghi
c) cfibehadg
d) adgbehcfi

Answer: d
Explanation: It starts with the first element and continues in the same column until the end of column is reached and then proceeds with the next column. Fortran follows column-major order.

Comments