From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,1d321b3a6b8bcab2 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 1995-01-29 22:11:15 PST Path: swrinde!pipex!uunet!gwu.edu!gwu.edu!not-for-mail From: mfeldman@seas.gwu.edu (Michael Feldman) Newsgroups: comp.lang.ada Subject: Re: "Subtract C, add Ada" Date: 30 Jan 1995 00:31:58 -0500 Organization: George Washington University Message-ID: <3ghtke$9jc@felix.seas.gwu.edu> References: <3fo2ot$su2@miranda.gmrc.gecm.com> <3fode9$dap@soleil.uvsq.fr> <3g1shu$ksc@rational.rational.com> <3gdro9$aud@spam.csv.warwick.ac.uk> NNTP-Posting-Host: 128.164.9.3 Date: 1995-01-30T00:31:58-05:00 List-Id: In article <3gdro9$aud@spam.csv.warwick.ac.uk>, Jules wrote: >Of course the correct version (and the version I still prefer) is: > >while (a[i++]!=b && i < ARRAYLIMIT); Hmmm - I think I learned somewhere that the && is short-circuit in C. So wouldn't you want to switch the two conditions, i.e. check the limit _before_ incrementing that index? (It's late at night; this comment may be off the wall.) Mike Feldman