??? 06/01/12 20:30 Read: times |
#187601 - Very Important Responding to: ???'s previous message |
Andy Peters said:
Justin Fontes said:
Per said:
An expression with multiple || will (and must) end evaluation on first true.
An expression with multiple && will (and must) end evaluation on first false. Completely true. This is called Short-circuit evaluation and details can be found here: http://en.wikipedia.org/wiki/Shor...evaluation Pretty good for being able to point to this out, Per. Excellent, thanks for the clear explanation. -a Yes, and this behavior of the C language can and sometimes is used to advantage in certain types of expressions. When you are studying code from someone else or doing design review type work lack of knowledge about how the language handles multi term expressions can be a killer. Michael Karas |