4 ms·
Relying on the short-circuiting behavior of || and && in C is a long-accepted idiom. It's practically the purpose of those operators. https://en.wikipedia.org
by tobinfricke 11y ago
Relying on the short-circuiting behavior of || and && in C is a long-accepted idiom. It's practically the purpose of those operators.
https://en.wikipedia.org/wiki/Short-circuit_evaluation#Common_usage https://en.wikipedia.org/wiki/Short-circuit_evaluation#Commo...
- damienkatz 11y agoThe obscure part is relying on a side effect of the first clause in the second clause.
- haberman 11y agoThat is pretty common and readable for '&&', but I agree it is too subtle and obscure for '||'.