Path: utzoo!attcan!uunet!lll-winken!lll-tis!ames!mailrus!husc6!cs.utexas.edu!ut-sally!ut-emx!chpf127
From: chpf127@ut-emx.UUCP (J. Eaton)
Newsgroups: comp.lang.c
Subject: Re: Dynamic multidimensional arrays
Summary: negative indices
Message-ID: <3342@ut-emx.UUCP>
Date: 15 Jun 88 08:59:05 GMT
References: <10655@agate.BERKELEY.EDU> <1857@hubcap.UUCP> <4556@haddock.ISC.COM>
Organization: The University of Texas at Austin, Austin, Texas
Lines: 22

In article <4556@haddock.ISC.COM> (Karl Heuer) writes:
> In article <59@cubsun.BIO.COLUMBIA.EDU> (Peter Shenkin) writes:
> >[What about]
> >	float **matrix( int nrl, int nrh, int ncl, int nch )
> >[and its N-dimensional generalization?]
> >	float **array( int Ndim, 
> >	  int n1l, int n1h, int n2l, int n2h, ..., int nNl, int nNh )
> 
> Since normal arrays in C are zero-based, I don't see any reason to
> specify the lower bounds.

   What if I decide I would like to have negative as well as positive
   (or zero) indices for arrays?

   Standard Fortran allows this.  Doesn't C?

> Karl W. Z. Heuer (ima!haddock!karl or karl@haddock.isc.com), The Walking Lint


   J. Eaton
   UT Dept of Chemical Engineering

   Walking Fortran 77 Lint (well, as close as there is around here anyway :-).