Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!uunet!steinmetz!philabs!pwa-b!mmintl!franka From: franka@mmintl.UUCP (Frank Adams) Newsgroups: comp.lang.c Subject: Re: type-indexed arrays (was: enum - enum ?) Message-ID: <2189@mmintl.UUCP> Date: Mon, 15-Jun-87 16:38:08 EDT Article-I.D.: mmintl.2189 Posted: Mon Jun 15 16:38:08 1987 Date-Received: Sun, 21-Jun-87 07:39:42 EDT References: <139@starfire.UUCP> <516@haddock.UUCP> <20540@sun.uucp> <526@haddock.UUCP> <184@auvax.UUCP> <1226@crash.CTS.COM> Reply-To: franka@mmintl.UUCP (Frank Adams) Organization: Multimate International, E. Hartford, CT. Lines: 24 In article <1226@crash.CTS.COM> ford@crash.CTS.COM (Michael "Ford" Ditto) writes: |In article <184@auvax.UUCP> rwa@auvax.UUCP (Ross Alexander) writes: |>I can think of only one little quibble with the above: C arrays are |>considered to begin with the zero'th element and end at the N-1'th |>element, right? | |According to K&R's C Reference Manual, section 14.3: | | "By definition, the subscript operator [] is interpreted in such a | way that E1 [ E2 ] is identical to * ( (E1) + (E2) )." | | int demo[ -10 .. 10 ]; |... |>Now, what is the value of the token 'demo' ? | |I think it should be the address of the FIRST element in demo (i.e. |demo[-10]). But this is incompatible with the quotation from K&R, above. 'demo' would have to mean '&demo[0]' for this definition to work. -- Frank Adams ihnp4!philabs!pwa-b!mmintl!franka Ashton-Tate 52 Oakland Ave North E. Hartford, CT 06108