 |
C++Talk.NET C++ language newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Guest
|
Posted: Mon May 07, 2007 9:11 am Post subject: operator evaluation question |
|
|
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
|
Posted: Mon May 07, 2007 9:11 am Post subject: Re: operator evaluation question |
|
|
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 |
|
 |
|
|
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
|
|