|
-
September 16th, 2009, 02:48 PM
#1
ordering of IF-statement conditions
Hello again.
Say, I wonder if anyone can tell me whether there is a definition of the order of evaluation of IF statement conditions in C#.
For instance, in the statement ...
if ( (delayInSecs == 0) || (--delayInSecs == 0)) {
doSomething();
}
does the C# compiler guarantee that 'delayInSecs' will never go negative as a result of evaluating that IF statement ?
Certainly I could just try it an see what happens, but that wouldn't tell me that the compiler guarantees that action, only that in this case the compiler did this or that.
Thanks for your help.
bill
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
|