Connecting Tech Pros Worldwide Help | Site Map

Evaluation Order in a Condition statement

=?utf-8?Q?David_C=C3=B4me?=
Guest
 
Posts: n/a
#1: Mar 18 '08
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.
Christopher
Guest
 
Posts: n/a
#2: Mar 18 '08

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
Paavo Helde
Guest
 
Posts: n/a
#3: Mar 18 '08

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.
Alexander Dong Back Kim
Guest
 
Posts: n/a
#4: Mar 19 '08

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