3 ms·
Yes. This mistake is very common in C. So much so that it's considered good practice to put the constant first when doing equality comparisons: if (10 == x
by AlexandrB 8y ago
Yes. This mistake is very common in C. So much so that it's considered good practice to put the constant first when doing equality comparisons:
if (10 == x)
This way accidentally missing a "=" triggers a compiler error instead of quietly doing the wrong thing.
- sorenjan 8y agoCalled Yoda conditions. https://en.wikipedia.org/wiki/Yoda_conditions https://en.wikipedia.org/wiki/Yoda_conditions