Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!rochester!cornell!batcomputer!garry From: garry@batcomputer.tn.cornell.edu (Garry Wiegand) Newsgroups: comp.lang.fortran,comp.lang.pascal Subject: Array storage order Message-ID: <1215@batcomputer.tn.cornell.edu> Date: Fri, 29-May-87 23:18:12 EDT Article-I.D.: batcompu.1215 Posted: Fri May 29 23:18:12 1987 Date-Received: Sun, 31-May-87 16:01:05 EDT Reply-To: garry@oak.cadif.cornell.edu Organization: Cornell Engineering && Flying Moose Graphics Lines: 19 Xref: mnetor comp.lang.fortran:109 comp.lang.pascal:164 We're trying to arrange for a C subroutine library to be callable from Fortran and Pascal and also transportable between machines. One of the questions that has come up is with respect to the storage order of 2-dimensional arrays. In C, array element [1][2] is stored in memory immediately after element [1][1]. I believe this is locked into the language - pointer arithmetic and all that. On the Fortran compilers I can get to, (2,1), not (1,2), immediately follows (1,1). The pascal I haven't investigated yet. Question: is this array storage order mandated by the Fortran-77 standard? How about the Pascal standard? If so, then I'll document the arrays as being "backwards" in these languages. If not, I'll keep two code versions. Obviously, two manual versions would be less hassle. Help appreciated. garry wiegand (garry@oak.cadif.cornell.edu - ARPA) (garry@crnlthry - BITNET)