Connecting Tech Pros Worldwide Help | Site Map

Evaluation Order in a Condition statement

 
LinkBack Thread Tools Search this Thread
  #1  
Old March 18th, 2008, 08:35 PM
=?utf-8?Q?David_C=C3=B4me?=
Guest
 
Posts: n/a
Default Evaluation Order in a Condition statement

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, 08:45 PM
Christopher
Guest
 
Posts: n/a
Default 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, 08:45 PM
Paavo Helde
Guest
 
Posts: n/a
Default 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, 04:45 AM
Alexander Dong Back Kim
Guest
 
Posts: n/a
Default 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,
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,840 network members.