4 ms·
Don't understand? If the constant is on the left, then forgetting one of the equals signs will always be an error.
by hibbelig 13y ago
Don't understand? If the constant is on the left, then forgetting one of the equals signs will always be an error.
- rguldener 13y agoYes but I think he is saying that if the left/what you compare to is not a constant then it will not warn you (if the type agrees, as it should anyway for a comparison).
- cbhl 13y agoIf the left is a function call, it will still error out because you can't assign to it. If you're doing if (var1 == var2) then yoda expressions won't save you, however.
- koenigdavidmj 13y agoAlso, in C++ you can assign to the return value of a function returning a reference.
- deletes 13y agoThe word learning in this context doesn't mean understanding this simple trick, which any newbie should grasp immediately.