|
|
1.1 root 1:
2:
3: precedence Definition precedence
4:
5:
6:
7:
8: Precedence refers to the property of each C operator that deter-
9: mines priority of execution. Operators are executed in order of
10: their degree of precedence, from highest to lowest.
11:
12: The following table summarizes the precedence of C operators.
13: The are listed in descending order of precedence: those listed
14: higher in the table are executed before those lower in the table.
15: Operators listed on the same line have the same level of
16: precedence.
17:
18:
19:
20: _O_p_e_r_a_t_o_r _A_s_s_o_c_i_a_t_i_v_i_t_y
21:
___________________________________________
22: () [] -> . Left to right
23:
___________________________________________
24: ! ~ ++ -- - (_t_y_p_e) * & _s_i_z_e_o_fRight to left
25:
___________________________________________
26: * / % Left to right
27:
___________________________________________
28: + - Left to right
29:
___________________________________________
30: << >> Left to right
31:
___________________________________________
32: < <= > >= Left to right
33:
___________________________________________
34: == != Left to right
35:
___________________________________________
36: & Left to right
37:
___________________________________________
38: ^ Left to right
39:
___________________________________________
40: | Left to right
41:
___________________________________________
42: && Left to right
43:
___________________________________________
44: || Left to right
45:
___________________________________________
46: ?: Right to left
47:
___________________________________________
48: = += -= *= /= %= Right to left
49:
___________________________________________
50: , Left to right
51:
___________________________________________
52:
53:
54: You can always determine precedence in an expression by enclosing
55: sub-expressions within parentheses: the expression enclosed
56: within the innermost parentheses is always executed first.
57:
58: ***** See Also *****
59:
60: definitions, operators
61: _T_h_e _C _P_r_o_g_r_a_m_m_i_n_g _L_a_n_g_u_a_g_e, ed. 2, page 48
62:
63:
64:
65:
66:
67:
68:
69:
70:
COHERENT Lexicon Page 1
71:
72:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.