Path: utzoo!attcan!uunet!cs.utexas.edu!yale!cmcl2!lanl!jlg From: jlg@lanl.gov (Jim Giles) Newsgroups: comp.lang.c Subject: Re: a style question Message-ID: <65016@lanl.gov> Date: 5 Oct 90 20:46:07 GMT References: <2544@cirrusl.UUCP> Organization: Los Alamos Natl Lab, Los Alamos, N.M. Lines: 21 From article <2544@cirrusl.UUCP>, by dhesi%cirrusl@oliveb.ATC.olivetti.com (Rahul Dhesi): > In <1990Oct4.152246.438@nntp-server.caltech.edu> > manning@nntp-server.caltech.edu (Evan Marshall Manning) writes: > >>And this is where the combination of a background in FORTRA[N|SH] and >>variables named "i" will bite you. In C it's the (i+1)th element in >>the series. > > Er, no. Some series start with a zero-eth element. They do, they > really do. Not in Fortran, perhaps, but in mathematics, yes. Some series begin with zero in Fortran as well. It is only C in the family of commonly available languages which doesn't allow the user to decide for himself what the subscript range of an array should be. Fortran, Pascal, Modula, Ada, etc., all allow the subscript range to have independent lower and upper bounds set for each rank of an array. Most of these languages require both bounds to be explicitly specified in the declaration. Fortran allows the extent to be given alone - in which case the lower bound of 0ne (1) is selected as a default. J. Giles