Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!mit-eddie!uw-beaver!tikal!amc!pilchuck!dataio!bright From: bright@dataio.Data-IO.COM (Walter Bright) Newsgroups: comp.lang.c Subject: Re: Absolute addressing in Turbo-C Message-ID: <1359@dataio.Data-IO.COM> Date: Fri, 4-Sep-87 13:16:08 EDT Article-I.D.: dataio.1359 Posted: Fri Sep 4 13:16:08 1987 Date-Received: Sat, 5-Sep-87 18:47:24 EDT References: <9140@brl-adm.ARPA> Reply-To: bright@dataio.UUCP (Walter Bright) Organization: Data I/O Corporation; Redmond, WA Lines: 16 In article <9140@brl-adm.ARPA> BREEBAAR%HLERUL5.BITNET@wiscvm.wisc.EDU writes: #It's this: Just WHY is it in C 'better' to write: *(a+n) instead of: a[n], #where 'a' is an array of something? And how much 'better' is it? #I remember reading on this list some time back that this does not extend to #arrays of more than one dimension. Why? Just because the expressions will #get too complex? *(a+n) and a[n] are exactly equivalent expressions. Neither is better as far as the compiler is concerned. As a programming style issue, however: *(a+n) should be used when a is a pointer a[n] should be used when a is an array This makes the code a little more readable. In fact, I would have enforced this in the language if I had designed it. This would have eliminated the 'pointer-array equivalence' kludge and all its associated kludges and confusion in the language.