Connecting Tech Pros Worldwide Help | Site Map

Evaluation Order in a Condition statement

  #1  
Old March 18th, 2008, 09:35 PM
=?utf-8?Q?David_C=C3=B4me?=
Guest
 
Posts: n/a
Hello.

Let A and B be 2 boolean expressions.
In the instruction if(A && B){/*..*/}, does the standard certify that A
will be evaluated first ?

Thanks a lot.
  #2  
Old March 18th, 2008, 09:45 PM
Christopher
Guest
 
Posts: n/a

re: Evaluation Order in a Condition statement


On Mar 18, 3:32 pm, David Côme <davidc...@wanadoo.frwrote:
Quote:
Hello.
>
Let A and B be 2 boolean expressions.
In the instruction if(A && B){/*..*/}, does the standard certify that A
will be evaluated first ?
>
Thanks a lot.
left to right
  #3  
Old March 18th, 2008, 09:45 PM
Paavo Helde
Guest
 
Posts: n/a

re: Evaluation Order in a Condition statement


=?utf-8?Q?David_C=C3=B4me?= <davidcome@wanadoo.frwrote in
news:op.t78bb5kyrttu86@debian:
Quote:
Hello.
>
Let A and B be 2 boolean expressions.
In the instruction if(A && B){/*..*/}, does the standard certify that A
will be evaluated first ?
Even more: if A yields false, B is not evaluated at all.
  #4  
Old March 19th, 2008, 05:45 AM
Alexander Dong Back Kim
Guest
 
Posts: n/a

re: Evaluation Order in a Condition statement


On Mar 19, 7:40 am, Christopher <cp...@austin.rr.comwrote:
Quote:
On Mar 18, 3:32 pm, David Côme <davidc...@wanadoo.frwrote:
>
Quote:
Hello.
>
Quote:
Let A and B be 2 boolean expressions.
In the instruction if(A && B){/*..*/}, does the standard certify that A
will be evaluated first ?
>
Quote:
Thanks a lot.
>
left to right
This is absolutely right! Lazy evaluation!

Cheers,
Closed Thread


Similar Threads
Thread Thread Starter Forum Replies Last Post
'if' statement to control switch case John answers 22 April 13th, 2007 03:55 PM
bug in msxml? confirmation requested. Matthias Truxa answers 19 November 18th, 2006 01:35 PM
Transact-SQL Help - CASE statement and Group By Chad Richardson answers 4 July 20th, 2005 06:15 AM
Conditions evaluation Steve Z answers 4 July 17th, 2005 09:46 PM