Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site brl-tgr.ARPA Path: utzoo!linus!decvax!genrad!mit-eddie!godot!harvard!seismo!brl-tgr!gwyn From: gwyn@brl-tgr.ARPA (Doug Gwyn ) Newsgroups: net.lang.c Subject: Re: C subscripts Message-ID: <5572@brl-tgr.ARPA> Date: Fri, 2-Nov-84 02:17:27 EST Article-I.D.: brl-tgr.5572 Posted: Fri Nov 2 02:17:27 1984 Date-Received: Sun, 4-Nov-84 05:08:24 EST References: <202@oliveb.UUCP> <48@drivax.UUCP> Organization: Ballistic Research Lab Lines: 16 > ... however I see problems with array[sub,sub]. Specificly > passing arrays a parameters would have to allow some way for the procedure > to know the size of the various dementions to compute the index of elements > of the array correctly. This is difficult in a losely typed language like C. > I think that pointers would have a similar problem. There is already a problem with using variable-sized arrays as parameters to C functions. This could be solved in the obvious way (`a la Fortran) without breaking any existing code, but there has been a remarkable lack of enthusiasm for the idea when it has been suggested to members of the ANSI C committee. As things now stand, array parameters must have CONSTANT dimensions specified for all but the first subscript. To have them determined dynamically at run-time (without being also passed in as parameters), a mechanism known as "templates" or "dope vectors" is required. This is too much complexity for C's intended purpose.