Sams Teach Yourself C++ in 21 Days

(singke) #1
limitations, 763-764
source code,
761-762
compared to functions,
771
compared to templates,
771
defining, 757
disadvantages, 771
parentheses ( ), 757-759
predefined, 760
syntax, 757
when to use, 787
main( ) function, 27, 100
Managed Extensions to
C++, 12
mathematical operators
combining with
assignment operator,
73-74
modulus (%), 73
subtraction (-), 71-72
mathematical pointers,
423-426
max_size( ) function, 695
member functions.
Seemethods
member variables. Seedata
members
member-wise copies, 298,
318
memory, 130. See also
pointers
addresses, 227-228
determining, 222-223
examining, 229-231
retrieving, 226
storing in pointers,
224-225
arrays, 421
code space, 130
examining, 747
free store
accessing, 239-241
advantages, 233-234
memory allocation,
234

objects, 238-239
pointers, 241-243
restoring, 235-237
leaks, 235-237, 283-285
RAM (random access
memory), 42, 130-132
registers, 130
stack
clearing, 233
pulling data from,
132-133
pushing data onto,
130-133
virtual methods, 403
menu( ) function, 204
Meow( ) function, 148, 153
methodologists, 332
methods, 140.See also
functions
base methods, 389-390
constructors, 154
calling multiple,
460-463
copy constructors,
298-302
defaults, 154-158, 295
initializing, 297
overloading, 294-296
declaring, 162-163
default values, 292-294
defining, 143-144
destructors, 154-158
friends, 580-585
get( ), 434
character arrays,
607-608
character reference
parameters, 606
with no parameters,
604-606
overloading, 610
header files, 267-268
hiding, 387-389
implementing, 151-154
inline, 163-166, 326

overloading, 387
example, 289-292
when to use, 294
overriding, 385-387
pointers
arrays, 531-532
declaring, 528
example, 528-530
invoking, 528
public accessor methods,
147-148
static, 511-512
accessing, 513
advantages, 534
calling, 511-513
sample listing, 512
virtual, 391-397
calling multiple,
393-395
copy constructors,
400-403
destructors, 399-400
memory costs, 403
slicing, 397-399
v-pointers, 396
v-tables, 396
mimicking RTTI (Run Time
Type Identification), 453
mixins, 473
models, 329-330. See also
UML (Unified Modeling
Language)
domain models, 339-341
association, 343
containment, 342-343
generalization, 341
dynamic models
collaboration
diagrams, 364
sequence diagrams,
363-364
state transition
diagrams, 364-366
static models, 354
modulus operator (%), 73
multidimensional arrays,
417-419

900 macros

34 0672327112 index.qxd 11/19/04 12:31 PM Page 900

Free download pdf