Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uflorida!haven!adm!smoke!gwyn From: gwyn@smoke.BRL.MIL (Doug Gwyn) Newsgroups: comp.lang.c Subject: Re: && operator (was: Re: comma operator) Message-ID: <10782@smoke.BRL.MIL> Date: 19 Aug 89 05:17:51 GMT References: <63244@linus.UUCP> <2300@oakhill.UUCP> <2650@aplcen.apl.jhu.edu> <20348@sequent.UUCP> Reply-To: gwyn@brl.arpa (Doug Gwyn) Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 19 In article <20348@sequent.UUCP> paulr@crg3.UUCP (Paul Reger) writes: -while ((ch = getchar()) != EOF && ch != '\n') -Is there any assurance in any C standard that the left expression will -always be evaluated first, with the right following it ?? I mean for -purposes of optimization, the right should be evaluated first, unless -there is something in some standard somewhere limiting such -optimizations... Any introductory C textbook will tell you how the && operator works. Certainly the standard reflects the way the operator has always been defined. (I'm refraining from simply answering the question, because I think you should find such a textbook and study it.) -I'm from Ada-land where such problems are handled by the 'and then' -clause. Whoopee do. It's not a problem.