|
|
 |
|
|
|
|
objects, 268 |
|
|
|
 |
|
|
|
|
overloading constructors, 259-260 |
|
|
|
 |
|
|
|
|
deriving, 392 |
|
|
|
 |
|
|
|
|
designing, 379, 385-386, 390-391 |
|
|
|
 |
|
|
|
|
encapsulation, 87, 379 |
|
|
|
 |
|
|
|
|
friend, 329, 345 |
|
|
|
 |
|
|
|
|
member data (objects from other classes), 322 |
|
|
|
 |
|
|
|
|
member functions |
|
|
|
 |
|
|
|
|
const, 99 |
|
|
|
 |
|
|
|
|
constructors, 94-95. See also constructors |
|
|
|
 |
|
|
|
|
methods, 87 |
|
|
|
 |
|
|
|
|
naming conventions, 88 |
|
|
|
 |
|
|
|
|
non-root, 386 |
|
|
|
 |
|
|
|
|
objects, compared, 88-89 |
|
|
|
 |
|
|
|
|
root, 386 |
|
|
|
 |
|
|
|
|
common, 386 |
|
|
|
 |
|
|
|
|
data, 388 |
|
|
|
 |
|
|
|
|
methods, 388 |
|
|
|
 |
|
|
|
|
naming, 387 |
|
|
|
 |
|
|
|
|
sharing knowledge, 393 |
|
|
|
 |
|
|
|
|
String, 242, 325-327 |
|
|
|
 |
|
|
|
|
templates, defining, 404 |
|
|
|
 |
|
|
|
|
clauses (else), 51-53 |
|
|
|
 |
|
|
|
|
cleaning |
|
|
|
 |
|
|
|
|
free store, 144 |
|
|
|
 |
|
|
|
|
stacks, 144 |
|
|
|
 |
|
|
|
|
clients, 87, 100 |
|
|
|
 |
|
|
|
|
clone methods, 276-279 |
|
|
|
 |
|
|
|
|
closing (}) brace, 21 |
|
|
|
 |
|
|
|
|
COBOL, 6 |
|
|
|
 |
|
|
|
|
code |
|
|
|
 |
|
|
|
|
debugging, 69, 352 |
|
|
|
 |
|
|
|
|
maintaining, 60, 62 |
|
|
|
 |
|
|
|
|
modifying, 20 |
|
|
|
 |
|
|
|
|
source, 11-12 |
|
|
|
 |
|
|
|
|
space, 143 |
|
|
|
 |
|
|
|
|
translating, 6 |
|
|
|
 |
|
|
|
|
writing, 434 |
|
|
|
 |
|
|
|
|
aligning braces, 434 |
|
|
|
 |
|
|
|
|
assert() statements, 439 |
|
|
|
 |
|
|
|
|
class definitions, 438 |
|
|
|
 |
|
|
|
|
comments, 437 |
|
|
|
 |
|
|
|
|
const keyword, 439 |
|
|
|
 |
|
|
|
|
function definitions, 438 |
|
|
|
 |
|
|
|
|
header files, 438 |
|
|
|
 |
|
|
|
|
identifiers, 436 |
|
|
|
 |
|
|
|
|
indenting switch statements, 435 |
|
|
|
 |
|
|
|
|
line length, 435 |
|
|
|
 |
|
|
|
|
program access, 438 |
|
|
|
 |
|
|
|
|
program text, 435-436 |
|
|
|
 |
|
|
|
|
spelling/capitalization, 436-437 |
|
|
|
 |
|
|
|
|
style, 434 |
|
|
|
 |
|
|
|
|
code listings |
|
|
|
 |
|
|
|
|
abstract data types, 286, 289-290 |
|
|
|
 |
|
|
|
|
accessing member data of objects (free store), 151-152 |
|
|
|
 |
|
|
|
|
Add() function, 212 |
|
|
|
 |
|
|
|
|
addition operator (+), 214-215 |
|
|
|
 |
|
|
|
|
ADTs (deriving from), 295-297 |
|
|
|
 |
|
|
|
|
arrays |
|
|
|
 |
|
|
|
|
declaring and using on free store, 237-238 |
|
|
|
 |
|
|
|
|
filling, 239-240 |
|
|
|
 |
|
|
|
|
integer, 226-227 |
|
|
|
 |
|
|
|
|
multidimensional, creating, 232-233 |
|
|
|
 |
|
|
|
|
objects, creating, 230 |
|
|
|
 |
|
|
|
|
pointers (member functions), 343-344 |
|
|
|
 |
|
|
|
|
pointers to functions, 333-335 |
|
|
|
 |
|
|
|
|
storing on free store, 234-235 |
|
|
|
 |
|
|
|
|
assert() macro, 357-358 |
|
|
|
 |
|
|
|
|
assignment operator (=), 217-218 |
|
|
|
 |
|
|
|
|
base class methods in derived classes, overriding, 261-262 |
|
|
|
 |
|
|
|
|
base methods, calling from the overridden method, 264-265 |
|
|
|
 |
|
|
|
|
calling functions, 23-24 |
|
|
|
 |
|
|
|
|
classes |
|
|
|
 |
|
|
|
|
creating, 208 |
|
|
|
 |
|
|
|
|
declaring, 105-106 |
|
|
|
 |
|
|
|
|
comments, 22 |
|
|
|
 |
|
|
|
|
compiler errors, 16 |
|
|
|
 |
|
|
|
|
complex, nested.if statements, 54 |
|
|
|
 |
|
|
|
|
const pointers, passing, 181-182 |
|
|
|
 |
|
|
|
|
constructors in derived classes, overloading, 256, 259 |
|
|
|
 |
|
|
|
|
constructors/destructors, calling, 254-256 |
|
|
|
 |
|
|
|
|
conversion operators, creating, 220 |
|
|
|
 |
|
|
|
|
copy constructors, defining, 201-203 |
|
|
|
 |
|
|
|
|
data slicing (passing by value), 273-275 |
|
|
|
 |
|
|
|
|
debugging levels, 366-369 |
|
|
|
 |
|
|
|
|
#define command, 349-350 |
|
|
|
 |
|
|
|
|
dowhile loop, 120 |
|
|
|
 |
|
|
|
|
driver programs, 394-400 |
|
|
|
 |
|
|
|
|
else clause, 52 |
|
|
|
 |
|
|
|
|
event loops, 380-382 |
|
|
|
 |
|
|
|
|
exceptions |
|
|
|
 |
|
|
|
|
polymorphic, 430-433 |
|
|
|
 |
|
|
|
|
raising, 424-427 |
|
|
|
 |
|
|
|
|
expressions, evaluating, 44 |
|
|
|
 |
|
|
|
|
for loops |
|
|
|
 |
|
|
|
|
empty for loop, 124-125 |
|
|
|
 |
|
|
|
|
multiple statements, 123 |
|
|
|
 |
|
|
|
|
nesting, 126 |
|
|
|
 |
|
|
|
|
null statement, 125 |
|
|
|
 |
|
|
|
|
null statements, 123-124 |
|
|
|
 |
|
|
|
|
simple for loop, 122 |
|
|
|
 |
|
|
|
|
functions |
|
|
|
 |
|
|
|
|
declaration/definition/ use, 63 |
|
|
|
 |
|
|
|
|
pure virtual, implementing, 291, 294 |
|
|
|
 |
|
|
|
|
goto loop, 112 |
|
|
|
 |
|
|
|
|
HELLO.CPP program, 14-15, 20 |
|
|
|
 |
|
|
|
|
if statements with braces, 55-57 |
|
|
|
 |
|
|
|
|
inheritance, simple, 250-251 |
|
|
|
 |
|
|
|
|
inline functions, 77 |
|
|
|
 |
|
|
|
|
int(), converting to, 221 |
|
|
|
 |
|
|
|
|
interfaces, 391 |
|
|
|
 |
|
|
|
|
Invariants() method, 360-364 |
|
|
|
 |
|
|
|
|
lists |
|
|
|
 |
|
|
|
|
linked, 304-309 |
|
|
|
 |
|
|
|
|
parameterized, 405-419 |
|
|
|
 |
|
|
|
|
member functions |
|
|
|
 |
|
|
|
|
overloading, 194-195 |
|
|
|
 |
|
|
|
|
static, 320-321 |
|
|
|
 |
|
|
|
|
memory leaks, 187 |
|
|
|
 |
|
|
|
|
methods, hiding, 263 |
|
|
|
 |
|
|
|
|
multiple return statements, 71-72 |
|
|
|
|
|