op= Compound Assignment operator
lval op= exp compound assignment
lval any variable that can be assigned to
op any binary operator except && or ||
exp any compatible expression
The op= operator is a shortcut for the expression
lval = lval op exp;
In other words, it performs the indicated operation, then assigns the
result to lval. If lval is a pointer and op is + or -, then exp can
be of an integral type.
-------------------------------- Examples ---------------------------------
i *= j; --> i = i * j;
i /= j; --> i = i / j;
i %= j; --> i = i % j;
i += j; --> i = i + j;
i -= j; --> i = i - j;
i <<= j; --> i = i << j;
i >>= j; --> i = i >> j;
i &= j; --> i = i & j;
i ^= j; --> i = i ^ j;
i |= j; --> i = i | j;
Seealso:
This page last updated on Fri Nov 30 10:48:32 MSK 2001
Copyright © 1992-2001, Vitaly Filatov, Moscow, Russia
Webmaster