Assignment Operators
= assigns the value at its right to the lvalue on its left.
Each of the following assignment operators updates the lvalue at its left by the value at its right, using the indicated operation. We use R-H for right-hand and L-H for left-hand.
+= adds the R-H quantity to the L-H variable and places the result in the L-H variable.
-= subtracts the R-H quantity from the L-H variable and places the result in the L-H variable.
*= multiplies the L-H variable by the R-H quantity and places the result in the L-H variable.
/= divides the L-H variable by the R-H quantity and places the result in the L-H variable.
%= gives the remainder from dividing the L-H quantity by the R-H quantity and places the result in the L-H variable.
&= assigns ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access