blob: 3e0b1b191d099b23e27d150b7e75232d357cb7f0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- saved from url=(0070)http://cwx.prenhall.com/bookbind/pubbooks/deitelcpp/medialib/appa.html -->
<HTML><HEAD><TITLE>Reference Material-Operator Precedence Chart</TITLE>
<META http-equiv=Content-Type content="text/html; charset=windows-1252">
<META content="MSHTML 5.50.4134.600" name=GENERATOR><LINK
href="appa-Dateien/APPEN_A.css" rel=STYLESHEET></HEAD>
<BODY text=#410d9c bgColor=#ffffff>
<CENTER><FONT size=+3><B>Operator Precedence Chart</B></FONT>
<P><BR>Operators are shown in decreasing order of precedence from top to bottom.
</P>
<TABLE cellSpacing=5 cellPadding=5 border=1>
<TBODY>
<TR>
<TH>
<P class=TCH><A name=pgfId=10391></A><EM class=Bold>Operator</EM> </P></TH>
<TH>
<P class=TCH><A name=pgfId=10393></A><EM class=Bold>Type</EM> </P></TH>
<TH>
<P class=TCH><A name=pgfId=10395></A><EM class=Bold>Associativity</EM>
</P></TH></TR>
<TR>
<TD>
<P class=CellBody><A name=pgfId=10397></A><EM class=Courier-Bold>::</EM>
</P>
<P class=CellBody><A name=pgfId=10398></A><EM class=Courier-Bold>::</EM>
</P></TD>
<TD>
<P class=CellBody><A name=pgfId=10400></A>binary scope resolution</P>
<P class=CellBody><A name=pgfId=10401></A>unary scope resolution</P></TD>
<TD vAlign=top>
<P class=CellBody><A name=pgfId=10403></A>left to right</P></TD></TR>
<TR>
<TD>
<P class=CellBody><A name=pgfId=10405></A><EM
class=Courier-Bold>()<BR>[]<BR>.</EM> </P>
<P class=CellBody><A name=pgfId=10406></A><EM
class=Courier-Bold>-></EM> </P>
<P class=CellBody><A name=pgfId=10407></A>++</P>
<P class=CellBody><A name=pgfId=10408></A>--</P>
<P class=CellBody><A name=pgfId=10409></A><B>typeid</B></P>
<P class=CellBody><A name=pgfId=10410></A><B>dynamic_cast<</B><EM
class=Italic> type </EM> <B>></B></P>
<P class=CellBody><A name=pgfId=10411></A><B>static_cast<</B><EM
class=Italic> type </EM> <B>></B></P>
<P class=CellBody><A name=pgfId=10412></A><B>reinterpret_cast<</B><EM
class=Italic> type </EM> <B>></B></P>
<P class=CellBody><A name=pgfId=10413></A><B>const_cast<</B><EM
class=Italic> type </EM> <B>></B></P></TD>
<TD>
<P class=CellBody><A name=pgfId=10415></A>parentheses<BR>array
subscript<BR>member selection via object</P>
<P class=CellBody><A name=pgfId=10416></A>member selection via pointer</P>
<P class=CellBody><A name=pgfId=10417></A>unary postincrement</P>
<P class=CellBody><A name=pgfId=10418></A>unary postdecrement</P>
<P class=CellBody><A name=pgfId=10419></A>run-time type information</P>
<P class=CellBody><A name=pgfId=10420></A>run-time type-checked cast</P>
<P class=CellBody><A name=pgfId=10421></A>compile-time type-checked
cast</P>
<P class=CellBody><A name=pgfId=10422></A>cast for non-standard
conversions</P>
<P class=CellBody><A name=pgfId=10423></A>cast away <EM
class=Courier-Bold>const</EM>-ness</P></TD>
<TD vAlign=top>
<P class=CellBody><A name=pgfId=10425></A>left to right</P></TD></TR>
<TR>
<TD>
<P class=CellBody><A name=pgfId=10427></A><EM
class=Courier-Bold>++<BR>--<BR>+<BR>-<BR>!<BR>~<BR>( </EM><EM
class=Italic>type</EM> <EM class=Courier-Bold>)</EM> </P>
<P class=CellBody><A name=pgfId=10428></A><B>sizeof</B></P>
<P class=CellBody><A name=pgfId=10429></A><B>&</B></P>
<P class=CellBody><A name=pgfId=10430></A><B>*</B></P>
<P class=CellBody><A name=pgfId=10431></A><B>new</B></P>
<P class=CellBody><A name=pgfId=10432></A><B>new[]</B></P>
<P class=CellBody><A name=pgfId=10433></A><B>delete</B></P>
<P class=CellBody><A name=pgfId=10434></A><B>delete[]</B></P></TD>
<TD>
<P class=CellBody><A name=pgfId=10436></A>unary preincrement<BR>unary
predecrement<BR>unary plus<BR>unary minus<BR>unary logical
negation<BR>unary bitwise complement<BR>C-style unary cast</P>
<P class=CellBody><A name=pgfId=10437></A>determine size in bytes</P>
<P class=CellBody><A name=pgfId=10438></A>address</P>
<P class=CellBody><A name=pgfId=10439></A>dereference</P>
<P class=CellBody><A name=pgfId=10440></A>dynamic memory allocation</P>
<P class=CellBody><A name=pgfId=10441></A>dynamic array allocation</P>
<P class=CellBody><A name=pgfId=10442></A>dynamic memory deallocation</P>
<P class=CellBody><A name=pgfId=10443></A>dynamic array
deallocation</P></TD>
<TD vAlign=top>
<P class=CellBody><A name=pgfId=10445></A>right to left</P></TD></TR>
<TR>
<TD>
<P class=CellBody><A name=pgfId=10447></A><B>.*</B></P>
<P class=CellBody><A name=pgfId=10448></A><B>->*</B></P></TD>
<TD>
<P class=CellBody><A name=pgfId=10450></A>pointer to member via object
</P>
<P class=CellBody><A name=pgfId=10451></A>pointer to member via
pointer</P></TD>
<TD vAlign=top>
<P class=CellBody><A name=pgfId=10453></A>left to right</P></TD></TR>
<TR>
<TD>
<P class=CellBody><A name=pgfId=10455></A><EM
class=Courier-Bold>*<BR>/<BR>%</EM> </P></TD>
<TD>
<P class=CellBody><A
name=pgfId=10457></A>multiplication<BR>division<BR>modulus</P></TD>
<TD vAlign=top>
<P class=CellBody><A name=pgfId=10459></A>left to right</P></TD></TR>
<TR>
<TD>
<P class=CellBody><A name=pgfId=10461></A><EM
class=Courier-Bold>+<BR>-</EM> </P></TD>
<TD>
<P class=CellBody><A name=pgfId=10463></A>addition<BR>subtraction</P></TD>
<TD vAlign=top>
<P class=CellBody><A name=pgfId=10465></A>left to right</P></TD></TR>
<TR>
<TD>
<P class=CellBody><A name=pgfId=10467></A><EM
class=Courier-Bold><<<BR>>></EM> </P></TD>
<TD>
<P class=CellBody><A name=pgfId=10469></A>bitwise left shift<BR>bitwise
right shift</P></TD>
<TD vAlign=top>
<P class=CellBody><A name=pgfId=10471></A>left to right</P></TD></TR>
<TR>
<TD>
<P class=CellBody><A name=pgfId=10473></A><EM
class=Courier-Bold><<BR><=<BR>><BR>>=</EM> </P></TD>
<TD>
<P class=CellBody><A name=pgfId=10475></A>relational less
than<BR>relational less than or equal to<BR>relational greater
than<BR>relational greater than or equal to</P></TD>
<TD vAlign=top>
<P class=CellBody><A name=pgfId=10477></A>left to right</P></TD></TR>
<TR>
<TD>
<P class=CellBody><A name=pgfId=10479></A><EM
class=Courier-Bold>==<BR>!=</EM> </P></TD>
<TD>
<P class=CellBody><A name=pgfId=10481></A>relational is equal
to<BR>relational is not equal to</P></TD>
<TD vAlign=top>
<P class=CellBody><A name=pgfId=10483></A>left to right</P></TD></TR>
<TR>
<TD>
<P class=CellBody><A name=pgfId=10485></A><EM
class=Courier-Bold>&</EM> </P></TD>
<TD>
<P class=CellBody><A name=pgfId=10487></A>bitwise AND</P></TD>
<TD vAlign=top>
<P class=CellBody><A name=pgfId=10489></A>left to right</P></TD></TR>
<TR>
<TD>
<P class=CellBody><A name=pgfId=10491></A><EM class=Courier-Bold>^</EM>
</P></TD>
<TD>
<P class=CellBody><A name=pgfId=10493></A>bitwise exclusive OR </P></TD>
<TD vAlign=top>
<P class=CellBody><A name=pgfId=10495></A>left to right </P></TD></TR>
<TR>
<TD>
<P class=CellBody><A name=pgfId=10497></A><EM class=Courier-Bold>|</EM>
</P></TD>
<TD>
<P class=CellBody><A name=pgfId=10499></A>bitwise inclusive OR </P></TD>
<TD vAlign=top>
<P class=CellBody><A name=pgfId=10501></A>left to right</P></TD></TR>
<TR>
<TD>
<P class=CellBody><A name=pgfId=10503></A><EM
class=Courier-Bold>&&</EM> </P></TD>
<TD>
<P class=CellBody><A name=pgfId=10505></A>logical AND</P></TD>
<TD vAlign=top>
<P class=CellBody><A name=pgfId=10507></A>left to right</P></TD></TR>
<TR>
<TD>
<P class=CellBody><A name=pgfId=10509></A><EM class=Courier-Bold>||</EM>
</P></TD>
<TD>
<P class=CellBody><A name=pgfId=10511></A>logical OR</P></TD>
<TD vAlign=top>
<P class=CellBody><A name=pgfId=10513></A>left to right</P></TD></TR>
<TR>
<TD>
<P class=CellBody><A name=pgfId=10515></A><EM class=Courier-Bold>?:</EM>
</P></TD>
<TD>
<P class=CellBody><A name=pgfId=10517></A>ternary conditional</P></TD>
<TD vAlign=top>
<P class=CellBody><A name=pgfId=10519></A>right to left</P></TD></TR>
<TR>
<TD>
<P class=CellBody><A name=pgfId=10521></A><EM
class=Courier-Bold>=<BR>+=<BR>-=<BR>*=<BR>/=<BR>%=<BR>&=<BR>^=<BR>|=<BR><<=<BR>>>=</EM>
</P></TD>
<TD>
<P class=CellBody><A name=pgfId=10523></A>assignment<BR>addition
assignment<BR>subtraction assignment<BR>multiplication
assignment<BR>division assignment<BR>modulus assignment<BR>bitwise AND
assignment<BR>bitwise exclusive OR assignment<BR>bitwise inclusive OR
assignment<BR>bitwise left shift assignment<BR>bitwise right shift with
sign</P></TD>
<TD vAlign=top>
<P class=CellBody><A name=pgfId=10525></A>right to left</P></TD></TR>
<TR>
<TD>
<P class=CellBody><A name=pgfId=10527></A>,</P></TD>
<TD>
<P class=CellBody><A name=pgfId=10529></A>comma</P></TD>
<TD vAlign=top>
<P class=CellBody><A name=pgfId=10531></A>left to
right</P></TD></TR></TBODY></TABLE>
<DIV></DIV>
<DIV></DIV>
<DIV></DIV></CENTER></BODY></HTML>
|