= += -= *= /= %= <<= >>= &= ^= |=
= is the obvious one. It takes the result of the expression on the right and assigns it to the variable on the left (lvalue).
main () { int a, b=4, c=10; a = b + c; }
I know this is stating the obvious, but:
main () main() { { int a=4; int a=4; a = a * 4; a *= 4; } }
The rule is as follows:
The lvalue is multiplied by the rvalue and the result assigned to the lvalue.
Here is another example.
main() main() { { int a=10, b=2; int a=10, b=2; a /= b * 5; a = a / (b*5); } }
Again both preduce the same answer (1).
Top | Master Index | Keywords | Functions |