4 ms·
and then and or then are shortcut operations, not the same as && and ||, those are and and or.
by Lucretia9 6y ago
and then and or then are shortcut operations, not the same as && and ||, those are and and or.
- MaxBarraclough 6y agoIn C and C++, the && and || operators both short-circuit. For eager semantics in C/C++ you could make do with the bitwise operators & and |, keeping in mind that they're bitwise and not logical. You could do something like (!!first_int) | (!!second_int). You'd be better off forcing eager evaluation by saving the results to local variables, and then use the short-circuit logical operators. Ada's and and or operators have no direct equivalents in C or C++. https://en.wikipedia.org/wiki/Short-circuit_evaluation#Support_in_common_programming_and_scripting_languages https://en.wikipedia.org/wiki/Short-circuit_evaluation#Suppo...