8. Operators

49 operators, 15 levels of precedence.

Associativity is left-to-right (LR) or right-to-left (RL).

In decreasing order of precedence:

  Assoc.  Operators
  ------  ---------
  LR      ()  []  ->  .  (type){list}  ++  --                         // postfix ++ -- ()
  RL      ++  --  +  -  !  ~  *  &  (type)  sizeof  _Alignof          // prefix ++ -- unary + -
  LR      *  /  %
  LR      +  -
  LR      <<  >>
  LR      <  <=  >  >=
  LR      ==  !=
  LR      &
  LR      ^
  LR      |
  LR      &&
  LR      ||
  RL      ?:
  RL      =  +=  -=  *=  /=  %= &=  ^=  |=  <<=  >>=
  LR      ,
(type){list} represents a compound literal, e.g. (int[]){2, 4}

(type) represents a cast, e.g. (double)i/j

See also en.cppreference.com/w/c/language/operator_precedence