How FORTRAN Stores Two-Dimensional Arrays in Memory

已淘汰的 KB 內容免責聲明

本文章所撰寫之相關產品,Microsoft 已不再提供支援。 因此,本文章將以「現狀」提供,並且將不再更新。


FORTRAN is different from languages such as C and Pascal in the way that it stores two-dimensional arrays in memory. Although array elements are referenced in row major notation, i.e., (row, column), just as in C or Pascal, FORTRAN stores two-dimensional arrays as one-dimensional column arrays.

For example, in C, a two-dimensional array with three rows and four columns will be stored in memory in the following sequence:
However, FORTRAN will store the same array in the following sequence:

文章識別碼:27780 - 最後檢閱時間:2003年12月1日 - 修訂: 1