The following table shows the precedence of operators in C. Where a statement involves the use of several operators, those with the lowest number in the table will be applied first.
Description Represented By
1 Parenthesis () []
1 Structure Access . ->
2 Unary ! ++ -- - * &
3 Multiply, Divide, Modulus * / %
4 Add, Subtract + -
5 Shift Right, Left >> <<
6 Greater, Less Than, etc > < =
7 Equal, Not Equal == !=
8 Bitwise AND &
9 Bitwise Exclusive OR ^
10 Bitwise OR |
11 Logical AND &&
12 Logical OR ||
13 Conditional Expression ?:
14 Assignment = += -= etc
15 Comma ,
Some of these operators have not been described in this course, consult a textbook if you want details about them.
No comments:
Post a Comment