0% found this document useful (0 votes)
83 views2 pages

This Page Lists C Operators in Order of Precedence

This document lists C operators in order of precedence from highest to lowest. It also indicates the associativity of operators of equal precedence. Parentheses are used to group sub-expressions and change precedence. Postfix increment/decrement operators evaluate the operand before incrementing/decrementing, but increment/decrement after the full expression is evaluated.

Uploaded by

vivekparashar
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
83 views2 pages

This Page Lists C Operators in Order of Precedence

This document lists C operators in order of precedence from highest to lowest. It also indicates the associativity of operators of equal precedence. Parentheses are used to group sub-expressions and change precedence. Postfix increment/decrement operators evaluate the operand before incrementing/decrementing, but increment/decrement after the full expression is evaluated.

Uploaded by

vivekparashar
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 2

This page lists C operators in order of precedence (highest to lowest).

Their associativity indicates in what order operators of equal precedence in an expression are applied. Operator () [] . -> ++ -++ -+ ! ~ (type) * & sizeof * + << < > == & ^ | && || ?: = += *= %= ^= <<= , Note 1: Parentheses are also used to group sub-expressions to force a different precedence; such parenthetical expressions can be nested and are evaluated from inner to outer. Note 2: Postfix increment/decrement have high precedence, but the actual increment or decrement of the operand is delayed (to be accomplished sometime before the statement completes execution). So in the statement y = x * z++; the current value of z is used to evaluate the expression (i.e., z++ evaluates to z) and z only incremented after all else / >> <= >= != % Description Parentheses (function call) (see Note 1) Brackets (array subscript) Member selection via object name Member selection via pointer Postfix increment/decrement (see Note 2) Prefix increment/decrement Unary plus/minus Logical negation/bitwise complement Cast (change type) Dereference Address Determine size in bytes Multiplication/division/modulus Addition/subtraction Bitwise shift left, Bitwise shift right Relational less than/less than or equal to Relational greater than/greater than or equal to Relational is equal to/is not equal to Bitwise AND Bitwise exclusive OR Bitwise inclusive OR Logical AND Logical OR Ternary conditional Assignment -= Addition/subtraction assignment /= Multiplication/division assignment &= Modulus/bitwise AND assignment |= Bitwise exclusive/inclusive OR assignment >>= Bitwise shift left/right assignment Comma (separate expressions) Associativity left-to-right

right-to-left

left-to-right left-to-right left-to-right left-to-right left-to-right left-to-right left-to-right left-to-right left-to-right left-to-right right-to-left right-to-left

left-to-right

is done. See postinc.c for another example.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy