Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!bloom-beacon!bu-cs!purdue!decwrl!sun!pitstop!sundc!seismo!uunet!steinmetz!davidsen From: davidsen@steinmetz.ge.com (William E. Davidsen Jr) Newsgroups: comp.lang.c Subject: Re: "for" loops in C ... Message-ID: <12388@steinmetz.ge.com> Date: 20 Oct 88 15:07:01 GMT References: <14999@agate.BERKELEY.EDU> <4700019@m.cs.uiuc.edu> <6945@cdis-1.uucp> <73408@sun.uucp> <23299@amdcad.AMD.COM> Reply-To: davidsen@crdos1.UUCP (bill davidsen) Organization: General Electric CRD, Schenectady, NY Lines: 22 In article <23299@amdcad.AMD.COM> tim@crackle.amd.com (Tim Olson) writes: | Didn't anyone else see what Dr. Andrews was pointing out? Saying that | you should avoid the construct 1["string"] is *like* saying you should | avoid a for loop, because both are fundamental constructs that a broken | C compiler may not implement correctly. Avoiding something fundamental | just because some compiler somewhere gets it wrong is no excuse -- FIX | THE COMPILER. I would suggest that there is a very good reason to avoid int[ptr], being that it's hard to read. Obviously it's part of the language, but is there any reason to use it other than to prove how well you understand C? That's real question, I would be pleased to learn that there really is some benefit, but I don't see much between int[prt], ptr[int] and *(ptr+int) other than readability. Obviously "string"[int] is legal, too, but somewhat less than readable to the casual programmer. -- bill davidsen (wedu@ge-crd.arpa) {uunet | philabs}!steinmetz!crdos1!davidsen "Stupidity, like virtue, is its own reward" -me