prev

Assignment Operators

next
  1. Situations like i = i + 2 occur quite frequently. C gives shorthand: i += 2

  2. The following binary operators have an assignment operator

    +, -, *, /, %, <<, >>, &, ^, |
  3. All assignment operators have the same form.
    expr1 op= expr2

  4. expr1 is only evaluated once so it is nice to use in complicated assignments.