|
-
September 12th, 2010, 06:12 AM
#1
Evaluation order of expression with single AND operator?
I have an expression in C: if (aaa = bbb && (ccc = getc(stdin)) != ddd), and I need the first expression to be evaluated first. Does C, and for that matter other programming languages, always evaluate from left to right with a single boolean like this, and do the parentheses like I have on the right side mean that this side is evaluated first? Or does it depend on the compiler?
I could just separate the expressions of course, but it is more compact this way.
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
|