|
|
 |
|
|
|
|
substituting |
|
|
|
 |
|
|
|
|
#define command for constants, 348 |
|
|
|
 |
|
|
|
|
predefined macros, 357 |
|
|
|
 |
|
|
|
|
strings, 352-353 |
|
|
|
 |
|
|
|
|
text, 38 |
|
|
|
 |
|
|
|
|
substitution (macros), 355 |
|
|
|
 |
|
|
|
|
substitution strings, 352-353 |
|
|
|
 |
|
|
|
|
swap() function, 70-71 |
|
|
|
 |
|
|
|
|
changing parameters, 171 |
|
|
|
 |
|
|
|
|
pointers, 168-170 |
|
|
|
 |
|
|
|
|
references, 170-171 |
|
|
|
 |
|
|
|
|
switch statements, 127, 429 |
|
|
|
 |
|
|
|
|
example, 128-129 |
|
|
|
 |
|
|
|
|
indenting, 435 |
|
|
|
 |
|
|
|
|
syntax, 127-128 |
|
|
|
 |
|
|
|
|
symbolic constants, 38-40 |
|
|
|
 |
|
|
|
|
syntactic bugs, 422 |
|
|
|
 |
|
|
|
|
syntax (derivation), 250 |
|
|
|
 |
|
|
|
|
tables (virtual), 299 |
|
|
|
 |
|
|
|
|
tail nodes, 302-304, 309 |
|
|
|
 |
|
|
|
|
TailNode object, 313 |
|
|
|
 |
|
|
|
|
targets, 162. See also references |
|
|
|
 |
|
|
|
|
template classes, defining, 404 |
|
|
|
 |
|
|
|
|
template functions, 420 |
|
|
|
 |
|
|
|
|
templates, 403-404, 420 |
|
|
|
 |
|
|
|
|
creating types. See also instantiation, 404 |
|
|
|
 |
|
|
|
|
items, passing, 412, 419 |
|
|
|
 |
|
|
|
|
overcoming macro problems, 355 |
|
|
|
 |
|
|
|
|
parameterized types, 404 |
|
|
|
 |
|
|
|
|
temporary objects |
|
|
|
 |
|
|
|
|
copy constructors, 178 |
|
|
|
 |
|
|
|
|
destroying, 178 |
|
|
|
 |
|
|
|
|
returning, 210 |
|
|
|
 |
|
|
|
|
terminate() functions, 429 |
|
|
|
 |
|
|
|
|
text, substituting, 38 |
|
|
|
 |
|
|
|
|
text editors, 16 |
|
|
|
 |
|
|
|
|
built-in (compilers), 17 |
|
|
|
 |
|
|
|
|
compilers, 11 |
|
|
|
 |
|
|
|
|
text files, 16 |
|
|
|
 |
|
|
|
|
text strings, 21 |
|
|
|
 |
|
|
|
|
this pointer, 154-155 |
|
|
|
 |
|
|
|
|
calling, 154 |
|
|
|
 |
|
|
|
|
creating, 156 |
|
|
|
 |
|
|
|
|
deleting, 156 |
|
|
|
 |
|
|
|
|
examining, 216-218 |
|
|
|
 |
|
|
|
|
storing memory addresses, 155 |
|
|
|
 |
|
|
|
|
throwing exceptions, 424, 427-428 |
|
|
|
 |
|
|
|
|
tilde (~), 94, 199 |
|
|
|
 |
|
|
|
|
time bombs, 156 |
|
|
|
 |
|
|
|
|
_TIME_macro (predefined), 357 |
|
|
|
 |
|
|
|
|
tokens, 348 |
|
|
|
 |
|
|
|
|
translating code/programs, 6 |
|
|
|
 |
|
|
|
|
transmitting information about problems (exceptions), 424 |
|
|
|
 |
|
|
|
|
trees (linked lists), 302 |
|
|
|
 |
|
|
|
|
true values, 59-60 |
|
|
|
 |
|
|
|
|
truth, 50 |
|
|
|
 |
|
|
|
|
try blocks, 424, 428 |
|
|
|
 |
|
|
|
|
type definition (typedef), 34-35 |
|
|
|
 |
|
|
|
|
pointers to functions, 338-339 |
|
|
|
 |
|
|
|
|
typedef statement, 338-339 |
|
|
|
 |
|
|
|
|
types, 85-86 |
|
|
|
 |
|
|
|
|
bool, 50 |
|
|
|
 |
|
|
|
|
creating, 86, 404 |
|
|
|
 |
|
|
|
|
variables, 28-31 |
|
|
|
 |
|
|
|
|
declaring, 135 |
|
|
|
 |
|
|
|
|
long, 35 |
|
|
|
 |
|
|
|
|
short, 35 |
|
|
|
 |
|
|
|
|
signed, 30 |
|
|
|
 |
|
|
|
|
unsigned, 30 |
|
|
|
 |
|
|
|
|
unary operators, 212-214, 435. See also Increment operator |
|
|
|
 |
|
|
|
|
#undef command, 352 |
|
|
|
 |
|
|
|
|
undefining, 352 |
|
|
|
 |
|
|
|
|
uninitialized |
|
|
|
 |
|
|
|
|
array elements, 243 |
|
|
|
 |
|
|
|
|
character arrays, 239 |
|
|
|
 |
|
|
|
|
unnecessary fragility bugs, 422 |
|
|
|
 |
|
|
|
|
unsigned integers, 30 |
|
|
|
 |
|
|
|
|
unsigned variable types, 30 |
|
|
|
 |
|
|
|
|
unsigned variables |
|
|
|
 |
|
|
|
|
long, 35 |
|
|
|
 |
|
|
|
|
short, 35 |
|
|
|
 |
|
|
|
|
wrapping around, 36 |
|
|
|
 |
|
|
|
|
unwinding call stack, 429 |
|
|
|
 |
|
|
|
|
use cases, 377 |
|
|
|
 |
|
|
|
|
user-created objects, 178 |
|
|
|
 |
|
|
|
|
user-defined objects, 200 |
|
|
|
 |
|
|
|
|
user-defined variables, 218 |
|
|
|
 |
|
|
|
|
v-pointer, 272 |
|
|
|
 |
|
|
|
|
v-table, 272, 279 |
|
|
|
 |
|
|
|
|
value |
|
|
|
 |
|
|
|
|
passing objects by, 328 |
|
|
|
 |
|
|
|
|
returning (functions), 71-73 |
|
|
|
 |
|
|
|
|
values |
|
|
|
 |
|
|
|
|
accessing, 138 |
|
|
|
 |
|
|
|
|
assigning, 94 |
|
|
|
 |
|
|
|
|
changing, 168-170 |
|
|
|
 |
|
|
|
|
deep copies, 200 |
|
|
|
 |
|
|
|
|
default |
|
|
|
 |
|
|
|
|
advantages, 198, 204 |
|
|
|
 |
|
|
|
|
declaring, 196-198 |
|
|
|
 |
|
|
|
|
overloaded functions, 205 |
|
|
|
 |
|
|
|
|
when to use, 198 |
|
|
|
 |
|
|
|
|
enumerated constants, 39 |
|
|
|
 |
|
|
|
|
false, 59-60 |
|
|
|
 |
|
|
|
|
incremented, 210 |
|
|
|
 |
|
|
|
|
interim, printing, 364-365, 371 |
|
|
|
 |
|
|
|
|
members (changing objects), 100 |
|
|
|
 |
|
|
|
|
multiple |
|
|
|
 |
|
|
|
|
returning, 172 |
|
|
|
 |
|
|
|
|
passing pointers, 172-173 |
|
|
|
 |
|
|
|
|
passing references, 172-175 |
|
|
|
 |
|
|
|
|
original, 210 |
|
|
|
 |
|
|
|
|
passing, 73, 180 |
|
|
|
 |
|
|
|
|
objects, 273-275 |
|
|
|
 |
|
|
|
|
parameters, 190 |
|
|
|
 |
|
|
|
|
pointers, 167-170 |
|
|
|
 |
|
|
|
|
references, 167-168 |
|
|
|
 |
|
|
|
|
pointers, 142 |
|
|
|
 |
|
|
|
|
returning, 24 |
|
|
|
 |
|
|
|
|
functions, 65, 78 |
|
|
|
 |
|
|
|
|
main() function, 21-23 |
|
|
|
 |
|
|
|
|
true, 59-60 |
|
|
|
 |
|
|
|
|
variables, 28, 33 |
|
|
|
 |
|
|
|
|
variables, 27, 87, 139. See also data members |
|
|
|
 |
|
|
|
|
addresses, 28 |
|
|
|
|
|