Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!wuarchive!gem.mps.ohio-state.edu!ginosko!brutus.cs.uiuc.edu!apple!rutgers!dptg!ulysses!andante!alice!ark From: ark@alice.UUCP (Andrew Koenig) Newsgroups: comp.lang.c Subject: Re: evaluation order Keywords: which way Message-ID: <9901@alice.UUCP> Date: 14 Sep 89 12:47:43 GMT References: <9361@attctc.Dallas.TX.US> Distribution: na Organization: AT&T Bell Laboratories, Liberty Corner NJ Lines: 24 In article <9361@attctc.Dallas.TX.US>, bobc@attctc.Dallas.TX.US (Bob Calbridge) writes: > if (write(handle, buf, len=strlen(buf)) != len) do_something(); > can I be assured that 'len' will be assigned the length of 'buf' before it > is used on the right side of the comparison operator. No you can't. However, you can be assured if you write it this way: len = strlen(buf); if (write(handle, buf, len) != len) do_something(); Is this so terrible? You can even write it this way: if (len = strlen(buf), write(handle, buf, len) != len) do_something(); but I far prefer the previous way. -- --Andrew Koenig ark@europa.att.com