Xref: utzoo comp.lang.c:31399 comp.lang.fortran:3668 Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!uakari.primate.wisc.edu!aplcen!uunet!munnari.oz.au!metro!news From: glenn@suphys.physics.su.OZ.AU Newsgroups: comp.lang.c,comp.lang.fortran Subject: C interfacing with Fortran Keywords: C, Fortran, interfacing Message-ID: <1990Aug27.220828.9319@metro.ucc.su.OZ.AU> Date: 27 Aug 90 22:08:28 GMT Reply-To: glenn@suphys.physics.su.OZ.AU () Organization: School of Physics, Uni of Sydney, Australia. Lines: 29 Hi, I'm trying to write a program which uses a 2-d array of structs to represent a matrix of complex numbers: struct complex {double r; double i}. The array is dynamically allocated as it can become rather large. I don't want to do complex arithmetic in C (we don't have C++ :-)) so I thought I'd use Fortran. Problem: How does one pass a 2-d C array of structs to a Fortran subroutine? I've managed to do it with a 1-d array, but our Manuals (SUN OS 4.1) say nothing about 2-d arrays; that part seems to just be a copy (with minor changes) of the version 7 UNIX manual. Any example programs or pointers to good cross language references would be much appreciated. BTW I'm using f77 and cc (standard SUN C compiler). Thanks in advance, Glenn glenn@qed.physics.su.oz.au -- Glenn Geers | "So when it's over, we're back to people. Department of Theoretical Physics | Just to prove that human touch can have The University of Sydney | no equal." Sydney NSW 2006 Australia | - Basia Trzetrzelewska, 'Prime Time TV'