Throughout our C programs thus far, we have used operators like +, =, and ++ in expressions such as
x = 9 + 3;We mean by this that 9 and 3 should be added together and the result assigned to variable x. We assumed that the + operator has higher precedence than the = operator. Our assumption was correct, but it's because the C language followed our intuition about operator precedence and associativity.
lists all C operators through the C99 standard in order of their precedence (highest to lowest).1 Operators within the same division have equal precedence.
| Prec. | Operator | Description | Associativity |
|---|---|---|---|
| 1 | ++ -- | Postfix … |
This is a preview. Read the full book in print or ebook — get it from MIT Press (ISBN 9780262548762).
Instructor with access? Instructor login.