Article View: net.lang.f77
Article #259arrays, anyone?
From: Dave Carlson
Date: Fri, 30 Aug 1985 14:41
Date: Fri, 30 Aug 1985 14:41
26 lines
1656 bytes
1656 bytes
Given a dimensioned fortran array A(50,300), I will set element A(10,100)=666,
just so a unique value is present. Now I pass the array to a c program via
the argument list. Given the column/row major differences, I can address the
fortran element A(10,100) as *(apntr+9*300+99) and get the correct answer.
The hassle with this is that the dimensionality of the array must be known to
the c program, ie. 300 must be known. Now, in C 2-d arrays are simply an array
of pointers to a linear array. My question is can I access the fortran array
above as a double indirection + offset, as I would a C array? Is there any way
of accessing the array that does not need to know the dimensions to get the
offset? [Suggestions like 'do it in fortran' are not needed--thanks!!]
thanks in advance.
"The Faster I Go the Behinder I Get"
--Lewis Carroll
Dave Carlson
{allegra,seismo,decvax}!rochester!ur-valhalla!dave
--
"The Faster I Go the Behinder I Get"
--Lewis Carroll
Dave Carlson
{allegra,seismo,decvax}!rochester!ur-valhalla!dave
Technical Details
Message-ID:
<390@ur-helheim.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!decvax!genrad!panda!talcott!harvard!seismo!rochester!ur-helheim!daveShow Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site ur-helheim.UUCP Path: arc1-ca.pugleaf.net!utzoo!decvax!genrad!panda!talcott!harvard!seismo!rochester!ur-helheim!dave From: dave@ur-helheim.UUCP (Dave Carlson) Newsgroups: net.lang.f77 Subject: arrays, anyone? Message-ID: <390@ur-helheim.UUCP> Date: Fri, 30-Aug-85 10:41:40 EDT Article-I.D.: ur-helhe.390 Posted: Fri Aug 30 10:41:40 1985 Date-Received: Sat, 31-Aug-85 17:59:17 EDT Reply-To: dave@ur-helheim.UUCP (Dave Carlson) Distribution: na Organization: U. of Rochester, EE Dept. Lines: 26