C++Talk.NET Forum Index C++Talk.NET
C++ language newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

operator evaluation question

 
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C Language
View previous topic :: View next topic  
Author Message
Guest






PostPosted: Mon May 07, 2007 9:11 am    Post subject: operator evaluation question Reply with quote



Hi,
I see the following description in <<Expert C Programming>>,

the order is defined for && and || and a couple of other operators.
These 2 evaluate their operands in a strict left-to-right oder,
stopping when the result is known.

Is this really true? I think the order is compiler dependent.

Thanks.
Back to top
Richard Heathfield
Guest





PostPosted: Mon May 07, 2007 9:11 am    Post subject: Re: operator evaluation question Reply with quote



linq936 (AT) hotmail (DOT) com said:

Quote:
Hi,
I see the following description in <<Expert C Programming>>,

the order is defined for && and || and a couple of other operators.
These 2 evaluate their operands in a strict left-to-right oder,
stopping when the result is known.

Is this really true? I think the order is compiler dependent.

The Standard mandates the order and the short-cut evaluation.
Implementations have no leeway in this regard.

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at the above domain, - www.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C Language All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.