Skip to content

Operators

Silver edited this page Aug 24, 2020 · 3 revisions

Support

Unary Operators:

  1. ++ (prefix and suffix)
  2. -- (prefix and suffix)
  3. * (get the value of address)
  4. & (get the address of variable)
  5. !
  6. ~
  7. sizeof
  8. -
  9. []: only for get the value of NSArray or NSDictionary. ( id a = b[x]; )

Binary Operators:

  1. +
  2. -
  3. *
  4. /
  5. %
  6. <<
  7. >>
  8. |
  9. &
  10. ^
  11. <
  12. <=
  13. >
  14. >=
  15. ==
  16. !=
  17. &&
  18. ||

Assign Operators:

  1. =
  2. /=
  3. *=
  4. %=
  5. +=
  6. -=
  7. <<=
  8. >>=
  9. &=
  10. ^=
  11. |=

Ternary Operators:

  1. a == b ? c : d
  2. a ?: b

Not Support

  1. -> : value->a
  2. {x, y, z}: int a[2] = {0, 0}; struct CGPoint a = {1, 2};
  3. []: int a[2]; // C Array Declaration.

Clone this wiki locally