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 - סקירה אחרונה: 1 בדצמ׳ 2003 - תיקון: 1