From: Erik Max Francis Newsgroups: comp.os.msdos.djgpp Subject: Re: [Q] expression evaluation order Date: Sun, 10 Aug 1997 00:49:51 -0700 Organization: Alcyone Systems Lines: 21 Message-ID: <33ED729F.358C912C@alcyone.com> References: <5sbb1h$kvr$1 AT newton DOT pacific DOT net DOT sg> NNTP-Posting-Host: newton.alcyone.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk Teemu Ikonen wrote: > > Is it safe to assume that the expression > > > > if(first_function()==OK && second_function()==OK && > > third_function()==OK) return(OK); > > > > will be evaluated from left to right? > > Theoretically no, in practise it could work. The && operator is _guaranteed_ to be short circuiting since the days of traditional C. Please don't add confusion to an otherwise simple issue. -- Erik Max Francis, &tSftDotIotE / email / mailto:max AT alcyone DOT com Alcyone Systems / web / http://www.alcyone.com/max/ San Jose, California, United States / icbm / 37 20 07 N 121 53 38 W \ "Love is not love which alters / when it alteration finds." / William Shakespeare, _Sonnets_, 116