versus vector objects, 188–189
array template class, 187
ArrayDb class, 791
arraynew.cpp, 166
arrayone.cpp, 117
arrays
addresses, 170
array notation, 173
arrays of objects, 546–549
declaring, 546
example, 547–549
initializing, 546
as function arguments, 322–325
const keyword, 327–328
declaring, 116–119
defined, 77, 116
design decisions, 325–326
displaying contents of, 327–328
dynamic arrays, 172–173
creating, 164–165
sample program, 165–167
examples, 328–331
filling, 326–327
function idioms, 331
functions and, 320–321
indexes, 117
initializing, 117–120
in C++11, 120
modifying, 328
naming, 172
one-dimensional arrays, 244
pointer arithmetic, 167–172
pointers, 321–322
ranges, 332–334
static binding, 172
strings, 123–124
initializing, 121
structures, 147–148
subscripts, 117
templates, non-type arguments, 843–845
two-dimensional arrays, 244–249, 337–339
declaring, 244–246
initializing, 246–249
variable arrays, 1329
versus vector objects, 188–189
arraytp.h, 843–844
arrfun1.cpp, 321
arrfun2.cpp, 323
arrfun3.cpp, 328
arrfun4.cpp, 332
arrstruc.cpp, 147–148
ASCII character set, table of, 1225–1229
assert, 1204
assgn_st.cpp, 145
assign() method, 1266, 1278
assignable objects, 1008
assigning
strings, 1266
values to pointers, 171
values to variables, 43
variable values, 43
assignment
string class, 133–134
type conversions, 103–104
assignment methods, 1260
assignment operator (=), 43–44, 644, 767–768, 772–775
compared to equality operator, 218–220
custom definitions, 645–646
enumerator values, setting, 152
enumerators, value ranges, 153
overloading, 652–658
sayings1.cpp, 656
string1.cpp, 653–656
string1.h, 652–653
potential problems, 645
strings, 133–134
structures, 145–146
when to use, 644
assignment operators, combination assignment operators, 211–212
assignment statements, 43–44
assignments, 1172–1173
associative containers, 1018, 1026
methods, 1281–1284
multimap, 1023–1025
set, 1019–1022
associativity, arithmetic operators, 99–100
associativity of operators, 1231
examples, 1234
table of, 1232–1234
asterisk (*), dereferencing operator (*) 155, 159
pointers 171–172
at() method, 1259
atan() function, 348
atan2() function, 348
ATM queue simulation
bank.cpp simulation, 695
Customer class, 694
Queue class
class declaration, 691
public interface, 679
ATM queue simulation, 678
bank.cpp simulation, 694–698
Customer class, 690–691
Queue class
class declaration, 694
design, 679
implementation, 680–682
methods, 682–690
public interface, 680
auto, 370
declarations, 1155
auto declarations, 109
auto keyword, 472
auto ptr, 1158
auto.cpp, 456–457
automatic memory storage, 182
automatic sizing (strings), 966–967
automatic teller machine simulation.
automatic type conversion.
automatic variables, 182, 314, 453–457
example, 455–457
initializing, 458
stacks, 458–459
autoptr template, 1333
auto_ptr class, 969, 973–975
versus unique_ptr, 975–977
average() function, 800
B
back insert iterators, 1005–1007
bad() method, 296
bad() stream state method, 1098–1102
badbit stream state, 1097–1102
bad_alloc exceptions, 921
Balance() function, 731
bank.cpp, 695–697
bank.cpp simulation, 694–698
Base 10 notation, 1215
Base 16 notation, 1216
binary equivalents, 1217–1218
Base 2 notation, 1217
hexadecimal equivalents, 1217–1218
Base 8 notation, 1215–1216
base classes
ABCs (abstract base classes), 746–749
ABC philosophy, 756
AcctABC example, 749–751, 754–755
enforcing interface rules with, 757
components, initializing, 798–799
friends, accessing, 801–804
methods, accessing, 800–801
objects, accessing, 801
relationships with derived classes, 718–720
TableTennisPlayer example, 708–710
using declarations, 807–808
virtual, methods, 826
virtual base classes, 815–817