0% found this document useful (0 votes)
31 views

COperatorPrecedenceTable PDF

The document lists C operators in order of precedence from highest to lowest. It also indicates the associativity of operators of equal precedence, describing whether they are applied from left to right or right to left. The table includes operators such as parentheses, arithmetic operators, relational operators, logical operators, bitwise operators, and assignment operators.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
31 views

COperatorPrecedenceTable PDF

The document lists C operators in order of precedence from highest to lowest. It also indicates the associativity of operators of equal precedence, describing whether they are applied from left to right or right to left. The table includes operators such as parentheses, arithmetic operators, relational operators, logical operators, bitwise operators, and assignment operators.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

C Operator Precedence Table

C operators are listed in order of precedence (highest to lowest). Their associativity


indicates in what order operators of equal precedence in an expression are applied.

Operator Description Associativity


() Parentheses: grouping or function call left-to-right
[] Brackets (array subscript)
. Member selection via object name
-> Member selection via pointer
++ -- Postfix increment/decrement
++ -- Prefix increment/decrement right-to-left
+- Unary plus/minus
!~ Logical negation/bitwise complement
(type) Cast (convert value to temporary value of type)
* Dereference
& Address (of operand)
sizeof Determine size in bytes on this implementation
* / % Multiplication/division/modulus left-to-right
+ - Addition/subtraction left-to-right
<< >> Bitwise shift left, Bitwise shift right left-to-right
< <= Relational less than/less than or equal to left-to-right
> >= Relational greater than/greater than or equal to
== != Relational is equal to/is not equal to left-to-right
& Bitwise AND left-to-right
^ Bitwise exclusive OR left-to-right
| Bitwise inclusive OR left-to-right
&& Logical AND left-to-right
|| Logical OR left-to-right
?: Ternary conditional right-to-left
= Assignment right-to-left
+= -= Addition/subtraction assignment
*= /= Multiplication/division assignment
%= &= Modulus/bitwise AND assignment
^= |= Bitwise exclusive/inclusive OR assignment
<<= >>= Bitwise shift left/right assignment
, Comma (separate expressions) left-to-right

You might also like