Xref: utzoo comp.lang.c:7476 comp.lang.fortran:454 Path: utzoo!mnetor!uunet!husc6!cmcl2!phri!roy From: roy@phri.UUCP (Roy Smith) Newsgroups: comp.lang.c,comp.lang.fortran Subject: Re: Conformant Arrays in C Message-ID: <3150@phri.UUCP> Date: 20 Feb 88 18:49:04 GMT References: <42529@sun.uucp> Reply-To: roy@phri.UUCP (Roy Smith) Organization: Public Health Research Inst. (NY, NY) Lines: 14 Keywords: ANSI C Fortran I'm not sure I follow all the details of David's note, but I thought I would throw in my suggestion anyway. Some time ago I had need for variable-dimension arrays in C. What I ended up using was vectored arrays. I wrote an array allocator which called malloc to get memory for the main array and for the row address vector, and which initialized the vector to point to the right places in the main array. After that, you could pretend you had a variable dimensional array; i.e. you could pass a subroutine the pointer returned by arrayalloc and the dimensions you used. It was posted a few years back to mod.sources. -- Roy Smith, {allegra,cmcl2,philabs}!phri!roy System Administrator, Public Health Research Institute 455 First Avenue, New York, NY 10016