Home : C Language : Operators
Highest precedence
( expression) |
parentheses |
variable++ ++ variablevariable -- -- variable |
increment the variable after using its
value increment the variable and then use its new value decrement the variable after using its value decrement the variable and then use its new value |
! value~ value- value+ value& variable* variablesizeof( type/variable) ( type) expression |
logical (Boolean) NOT bitwise NOT (one's complement) unary minus (arithmetic negation) unary plus returns the address of the variable returns the value pointed to by the pointer variable returns the number of bytes required for that type forces the expression to be evaluated as type |
value * valuevalue / valuevalue % value |
multiplication division modulus (the remainder from a division) |
value + valuevalue - value |
addition subtraction |
value << countvalue >> count |
shift the value left by the number of bits in
count shift the value right by the number of bits in count |
value < valuevalue > valuevalue <= valuevalue >= value |
less than (returns true or false) greater than (returns true or false) less than or equal (returns true or false) greater than or equal (returns true or false) |
value == valuevalue != value |
equal (returns true or false) not equal (returns true or false) |
value & value |
bitwise AND |
value ^ value |
bitwise XOR |
value | value |
bitwise OR |
value &&
value |
logical (Boolean) AND |
value || value |
logical (Boolean) OR |
exprA ? exprB :
exprC |
if exprA is true, then evaluate exprB and return its value, else evaluate exprC and return its value |
variable = expressionvariable op= expression |
assign the value of the expression to the
variable, and return that value equivalent to variable = variable op expression, where op is one of * / % + - << >> &
^ | |
exprA, exprB |
evaluate exprA, then evaluate exprB and return its value |
Lowest precedence