Hm, actually
a + b = c won't even
compile.
+ has higher
precedence than
=, so it resolves to
( a + b ) = c; literally, you're assigning the value of
c to an
expression, which isn't gonna work. That's not to say that you can't
dereference an
expression returning a
pointer and assign to
that expression, but that's a different thing:
Dereferencing expressions return
lvalues. Most expressions don't, including
arithmetic expressions.
So, anyhow,
MSVC says "
error C2106: '=' : left operand must be l-value", and
GCC says "
invalid lvalue in assignment".
For breadth, by the way, it should probably be noted that
Java,
JavaScript,
awk, and probably a few others also use
== for comparison. By way of a similar convention,
Pascal (which is
not my favorite language) uses
:= for
assignment and
= for
comparison.