|
-
November 17th, 2008, 04:42 AM
#1
[RESOLVED] order of evaluation of condition expression.
Hi all,
I have written some production level code assuming that if there is something like
Code:
if ( condition A || condition B || condition C)
or
if ( condition A && condition B && condition C)
the conditions will be evaluated left to right. i.e. A first, B next and C last.
Someone who reviewed my code from Ireland has commented that the standards don't guarantee any such thing.
I have found this in the K&R, which says: C does not guarantee the order of evaluation of expressions other than for ||, &&, comma and the ?: operators.
Can someone who is conversant with the current standards let me know if I am right or wrong?
I
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|