How FORTRAN Stores Two-Dimensional Arrays in Memory

रिटायर्ड KB सामग्री अस्वीकरण

यह आलेख उन उत्पादों के बारे में लिखा गया था जिनके लिए अब Microsoft समर्थन प्रदान नहीं करता है . इसलिए, यह आलेख "जैसा है" वैसा ही ऑफ़र किया गया है और अब इसका अद्यतन नहीं किया जाएगा.

Summary

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:
(1,1),(1,2),(1,3),(1,4),(2,1),(2,2),(2,3),(2,4),(3,1),(3,2),(3,3),(3,4)
However, FORTRAN will store the same array in the following sequence:
(1,1),(2,1),(3,1),(1,2),(2,2),(3,2),(1,3),(2,3),(3,3),(1,4),(2,4),(3,4)
गुण

आलेख ID: 27780 - पिछली समीक्षा: 01/12/2003 - संशोधन: 1

प्रतिक्रिया