Skip to content

Latest commit

 

History

History
24 lines (18 loc) · 798 Bytes

Shorthand Operators.md

File metadata and controls

24 lines (18 loc) · 798 Bytes

perators Involving LValues (i.e. a variable or something that can be assigned to)

  1. a += e is equivalent to a = a + e. The operators -=, *=, /=, %=, |=, &= and ^= are defined accordingly

  2. a++ and a-- are equivalent to a += 1 / a -= 1 but the expression itself still has the previous value of a

  3. In contrast, --a and ++a have the same effect on a but return the value after the change


Slide Screenshot

066.jpg


Slide Deck

  • LValues -> Assigned To
  • a += e is a = a + e
  • a++/a-- -> a += 1 & a -= 1
  • --a/++a -> a += 1 & a -= 1
  • Expr -> Modified Value

References