INDEX


SYMBOLS


! (logical NOT) operator, 76-77     DAY 4    
!= (not equals) operator, 67     DAY 4    
# (pound symbol)
preprocessors, 20     DAY 2    
stringizing operator, 537     DAY 17   
## (concatenation) operator, 537-538     DAY 17   
% (modulus) operator, 59-60     DAY 4    
%= (self-assigned modulus) operator, 62     DAY 4    
& (ampersand)
address of operator with references, 229-232     DAY 9    
bitwise AND operator, 655     DAY 21   
reference operator, 228     DAY 9    
&& (logical AND) operator, 76-77     DAY 4    
* (asterisk)
indirection operator, 201-202     DAY 8    
multiplication operator, 59     DAY 4    
*= (self-assigned multiplication) operator, 62     DAY 4    
+ (addition) operator, 59     DAY 4    
overloading, 286-287     DAY 10   
++ (increment) operator, 62     DAY 4    
overloading
postfix, 282-284     DAY 10   
prefix, 276-278     DAY 10   
returning
temporary objects, 278-280     DAY 10   
this pointer, 281-282     DAY 10   
+= (self-assigned addition) operator, 62     DAY 4    
- (subtraction) operator, 59     DAY 4    
-- (decrement) operator, 62     DAY 4    
-= (self-assigned subtraction) operator, 62     DAY 4    
. (member access) operator, 127     DAY 6    
/ (division) operator, 59     DAY 4    
/* characters, C-style comments, 23     DAY 2    
// characters, C++-style comment, 23     DAY 2    
/= (self-assigned division) operator, 62     DAY 4    
< (less than) operator, 67     DAY 4    
<< (insertion) operator
as friend function, 596-599     DAY 19   
overloading, 478-480     DAY 15   
with cout object, 504     DAY 16   
= (assignment) operator, 40, 59     DAY 3         DAY 4    
combining with mathematical operators, 61-62     DAY 4    
overloading, 288-291     DAY 10   
== (equals) operator, 66     DAY 4    
> (greater than) operator, 67     DAY 4    
>= (greater than or equals) operator, 67     DAY 4    
>> (extraction) operator (overloaded), with cin object, 496-501     DAY 16   
?: (conditional) operator, 79-80     DAY 4    
[] (index) operator, 308     DAY 11   
\ (backslash) escape character, 46     DAY 3    
\" (double quote) escape character, 47     DAY 3    
\' (single quote) escape character, 47     DAY 3    
\? (question mark) escape character, 47     DAY 3    
\\ (backslash displayed) escape character, 47     DAY 3    
\0 (null) character, 317     DAY 11   
\b (backspace) escape character, 47     DAY 3    
\n (new line) escape character, 21, 47     DAY 2         DAY 3    
\t (tab) escape character, 23, 47     DAY 2         DAY 3    
^ (bitwise exclusive OR) operator, 656     DAY 21   
{} (braces), 21     DAY 2    
aligning, 70     DAY 4    
in nested if statements, 74-76     DAY 4    
| (bitwise OR) operator, 655     DAY 21   
|| (logical OR) operator, 76-77     DAY 4    
~ (complement) operator, 656     DAY 21   
0 (zero), false value, 66     DAY 4    
in if statements, 78-79     DAY 4    
80/20 design rule, 569     DAY 18   
80/80 design rule, 569     DAY 18   

A


abstract data types, see ADTs
accessing portions of programs, coding styles, 664-665     DAY 21   
accessor member functions, 131-132     DAY 6    
Add() function, 284-285     DAY 10   
addition, incrementing, 62-64     DAY 4    
addition operators
+ (addition), 59     DAY 4    
overloading, 286-287     DAY 10   
+= (self-assigned), 62     DAY 4    
address of (&) operator, with references, 229-232     DAY 9    
addresses
author, 668     DAY 21   
obtaining, 198-200     DAY 8    
pointers, checking, 204-206     DAY 8    
references, 229-232     DAY 9    
versus pointers versus variable values, 202-203     DAY 8    
ADTs (abstract data types), 393-396     DAY 13   
deriving from other ADTs, 400-404     DAY 13   
determining when to make abstract, 404     DAY 13   
pure virtual functions, 396-397     DAY 13   
alarm system simulation, 555-560     DAY 18   
aliases
references, 228-232     DAY 9    
variables, 42-43     DAY 3    
aligning
{} (braces), 70     DAY 4    
coding styles, 661     DAY 21   
switch statements, coding styles, 661     DAY 21   
tabs, coding styles, 660     DAY 21   
allocating memory on free store, 208-209     DAY 8    
ambiguity, 383-388     DAY 13   
AND operators
& (bitwise), 655     DAY 21   
&& (logical), 76-77     DAY 4    
APIs (Application Program Interfaces), 570-571     DAY 18   
appending
strings, 648-649     DAY 21   
to files, 515-517     DAY 16   
arguments
command-line, 519-522     DAY 16   
functions, 98     DAY 5    
passing by reference, 234-238     DAY 9    
passing by value, 98-100     DAY 5    
passing pointers to functions as, 423-424     DAY 14   
ofstream objects, changing defaults, 515-517     DAY 16   
array classes
parameterized, 586-587     DAY 19   
templates
declaring, 587-589     DAY 19   
implementing, 589-592     DAY 19   
names, 589     DAY 19   
writing, 334     DAY 11   
arrays, 300     DAY 11   
char (character), 317-319     DAY 11   
concatenating, 537-538, 648-649     DAY 17        DAY 21   
copying into other strings, 319-321, 645-648     DAY 11        DAY 21   
extracting from input, 499-501     DAY 16   
filling with cin, 493-495     DAY 16   
lengths, determining, 644-645     DAY 21   
parsing, 504     DAY 16   
substitutions, 526-529, 537     DAY 17   
writing to output, 505-506     DAY 16   
declaring, 300, 307-308     DAY 11   
on free store, 314     DAY 11   
deleting on free store, 316-317     DAY 11   
elements, 301-302     DAY 11   
numbering, 302     DAY 11   
initializing, 305-306     DAY 11   
multidimensional, 309-310     DAY 11   
initializing, 310-312     DAY 11   
names, as pointers, 315-316     DAY 11   
of objects, 308-309     DAY 11   
of pointers, 312-314     DAY 11   
to functions, 421-422     DAY 14   
to member functions, 429-430     DAY 14   
versus pointers to arrays, 314-315     DAY 11   
sorting, 652-654     DAY 21   
storing unknown quantities of data, 312     DAY 11   
writing past ends of, 302-304     DAY 11   
fence post errors, 305     DAY 11   
ASCII
code set, 694   Appendix C 
converting to integers, 651-652     DAY 21   
assembly code, viewing, 639     DAY 20   
assert() macro, 538-550     DAY 17   
coding styles, 666     DAY 21   
assignment operator (=), 40, 59     DAY 3         DAY 4    
combining with mathematical operators, 61-62     DAY 4    
overloading, 288-291     DAY 10   
atoi() function, 651-652     DAY 21   
author address, 668     DAY 21   

B


backslash (\) escape character, 46     DAY 3    
backslash displayed (\\) escape character, 47     DAY 3    
backspace (\b) escape character, 47     DAY 3    
bad() function, 513     DAY 16   
base classes, 339-340     DAY 12   
initializing, 346-350     DAY 12   
overriding member functions, 350-355     DAY 12   
percolating functions up into, 374     DAY 13   
shared, multiple inheritance ambiguity, 384-388     DAY 13   
binary
files versus text files, 517-519     DAY 16   
numbering system, 692-694   Appendix C 
operators, overloading, 287     DAY 10   
binding
dynamic (run-time), 359     DAY 12   
static (compile-time), 359     DAY 12   
bit fields, 657-660     DAY 21   
bits (BInary digiTs), 693   Appendix C 
clearing, 656-657     DAY 21   
flipping, 657     DAY 21   
setting, 656     DAY 21   
bitwise operators, 655-656     DAY 21   
blocks, 57     DAY 4    
catch, 619, 623-627     DAY 20   
defining local variables within, 96-97     DAY 5    
try, 619, 623     DAY 20   
determining locations, 624     DAY 20   
bodies
of functions, 28, 90     DAY 2         DAY 5    
of loops
executing at least once, 168-170     DAY 7    
for, empty, 175     DAY 7    
books, source material, 666-669     DAY 21   
braces ({}), 21     DAY 2    
aligning, 70     DAY 4    
coding styles, 661     DAY 21   
in nested if statements, 74-76     DAY 4    
branching, 67-74     DAY 4    
to multiple values, 180-186     DAY 7    
break statement, with while loops, 163-165     DAY 7    
breakpoints, 638     DAY 20   
buffers, 487-489     DAY 16   
flushing, 487-489     DAY 16   
output, 504     DAY 16   
streams, 490     DAY 16   
bugs, 616-617     DAY 20   
bulletproof programs, 617     DAY 20   
buying libraries versus writing routines, 568     DAY 18   
bytes, 693   Appendix C 

C


C experience, 9     DAY 1    
.C file extension, 10, 144     DAY 1         DAY 6    
C++ language, history, 4-5, 9     DAY 1    
C++-style comments, 23-24     DAY 2    
C-style comments, 23     DAY 2    
calculations
incrementing/decrementing, 62-64     DAY 4    
rectangle areas, 41-42     DAY 3    
subtracting large numbers from small numbers, 59-60     DAY 4    
call stack, 624     DAY 20   
calling base class member functions, 353-355     DAY 12   
capability classes (Mixins), 392-393     DAY 13   
case sensitivity
coding styles, 663-664     DAY 21   
naming classes/member variables/member functions, 126     DAY 6    
variables, 39     DAY 3    
casting down, 375-376     DAY 13   
CAT.CPP program, 146-147     DAY 6    
CAT.HPP header file, 146     DAY 6    
catch blocks, 619     DAY 20   
syntax, 623     DAY 20   
catch statements, 624     DAY 20   
multiple, 625-627     DAY 20   
catching exceptions, 624-627     DAY 20   
cerr object, 490     DAY 16   
chaining up, 387     DAY 13   
char (character) variables, 36-37, 45-47     DAY 3    
size, 35     DAY 3    
char arrays, 317-319     DAY 11   
concatenating, 537-538, 648-649     DAY 17        DAY 21   
copying into other strings, 319-321, 645-648     DAY 11        DAY 21   
extracting from input, 499-501     DAY 16   
filling with cin, 493-495     DAY 16   
lengths, determining, 644-645     DAY 21   
parsing, 504     DAY 16   
substitutions, 537     DAY 17   
defining, 526-529     DAY 17   
writing to output, 505-506     DAY 16   
characters, 35     DAY 3    
escape, 46-47     DAY 3    
fill, 507-508     DAY 16   
ignoring remaining, 501-503     DAY 16   
numbers as, 46     DAY 3    
single
extracting from input, 496-498     DAY 16   
inserting in input, 503-504     DAY 16   
viewing in input, 503-504     DAY 16   
writing to output, 504-505     DAY 16   
cin object, 490-496     DAY 16   
member functions, 496-504     DAY 16   
classes, 8, 12     DAY 1    
array
parameterized, 586-587     DAY 19   
writing, 334     DAY 11   
base, 339-340     DAY 12   
initializing, 346-350     DAY 12   
overriding member functions, 350-355     DAY 12   
percolating functions up into, 374     DAY 13   
shared, multiple inheritance ambiguity, 384-388     DAY 13   
capability (Mixins), 392-393     DAY 13   
components, 125     DAY 6    
containing other classes, 448-458     DAY 15   
converting between built-in and user-defined, 291-294     DAY 10   
Counter, 274-291     DAY 10   
declaring, 125-126, 133-134     DAY 6    
compiler errors, 141-144     DAY 6    
file locations, 144-145     DAY 6    
including simpler classes, 148-151     DAY 6    
derived, 339     DAY 12   
constructors, 344-350     DAY 12   
destructors, 344-350     DAY 12   
protected access, 342-344     DAY 12   
designing, 564-566     DAY 18   
components, 570-572     DAY 18   
friend, 468-475     DAY 15   
template class declarations, 593-599     DAY 19   
fstream, 490     DAY 16   
implementing in terms of, versus delegation, 458-464     DAY 15   
invariants, 541-546     DAY 17   
ios, 490     DAY 16   
iostream, 490     DAY 16   
istream, 490     DAY 16   
members, see members of classes
naming, 126     DAY 6    
ostream, 490     DAY 16   
program design
designing, 557-558     DAY 18   
determining, 556-557     DAY 18   
root, 565-566     DAY 18   
streambuf, 490     DAY 16   
String, 321-327     DAY 11   
versus objects, 127     DAY 6    
clearing bits, 656-657     DAY 21   
clog object, 490     DAY 16   
close() function, 513     DAY 16   
closing files after input/output, 513     DAY 16   
code rot, 618     DAY 20   
coding styles, 660-666     DAY 21   
command line, #define from, 530     DAY 17   
command-line processing, 519-522     DAY 16   
comments, 23-26     DAY 2    
coding styles, 664     DAY 21   
compile-time (static) binding, 359     DAY 12   
compiler errors, 15     DAY 1    
class declarations, 141-144     DAY 6    
member is ambiguous, 383     DAY 13   
compilers, 5     DAY 1    
intermediate files, reading/viewing, 526     DAY 17   
compiling
conditional, 532     DAY 17   
source code, 11-12     DAY 1    
complement (~) operator, 656     DAY 21   
compound statements, 57     DAY 4    
computers, requirements, 10-11     DAY 1    
concatenating strings, 537-538, 648-649     DAY 17        DAY 21   
concatenation (##) operator, 537-538     DAY 17   
condition objects, creating during program design, 558     DAY 18   
conditional (?:) operator, 79-80     DAY 4    
conditional
compiling, 532     DAY 17   
if statements, 67-76     DAY 4    
const keyword, 48-49     DAY 3    
coding styles, 666     DAY 21   
member functions, 140-141     DAY 6    
objects
pointers to, 221-222     DAY 8    
this pointers to, 222-223     DAY 8    
pointers, 220-221     DAY 8    
passing, 245-247     DAY 9    
constants, 47     DAY 3    
enumerated, 49-51     DAY 3    
literal, 47     DAY 3    
string substitution, 527     DAY 17   
symbolic, 48-49     DAY 3    
constructors, 136-140     DAY 6    
contained classes, 454-456     DAY 15   
copy, 242-245, 270-274     DAY 9         DAY 10   
virtual, 363-366     DAY 12   
default, 267     DAY 10   
derived classes, 344-350     DAY 12   
multiple inheritance, 381-383     DAY 13   
overloading, 267-269     DAY 10   
containment, 448-458     DAY 15   
continue statement, with while loops, 163-165     DAY 7    
conversion operators, 291-294     DAY 10   
conversion specifiers, 510-511     DAY 16   
converting
ASCII to integers, 651-652     DAY 21   
between numbering system bases, 691-692   Appendix C 
copy constructors, 242-245, 270-274     DAY 9         DAY 10   
virtual, 363-366     DAY 12   
copy destructors, 242-245     DAY 9    
copying strings into other strings, 319-321, 645-648     DAY 11        DAY 21   
Counter class, 274-291     DAY 10   
counting variables, conventions, 177     DAY 7    
cout streams, 21-23, 490, 504     DAY 2         DAY 16   
formatting output, 506-510     DAY 16   
member functions, 504-506     DAY 16   
versus printf() statement, 510-512     DAY 16   
.CP file extension, 10     DAY 1    
.CPP file extension, 10, 144     DAY 1         DAY 6    
ctime() function, 650-651     DAY 21   

D


dangling pointers, 218-220     DAY 8    
data
analysis, developing programs, 563     DAY 18   
hiding, 8     DAY 1    
slicing, 361-363     DAY 12   
storing, free store, 207-217     DAY 8    
structures, source materials, 667     DAY 21   
types, ADTs (abstract data types), 393-404     DAY 13   
data members, see member variables
__DATE__ macro, 538     DAY 17   
dates, time library, 650-651     DAY 21   
debuggers, 638-639     DAY 20   
debugging, 638     DAY 20   
arrays
numbering elements, 302     DAY 11   
writing past ends of, 302-305     DAY 11   
asserting values to be true, 540     DAY 17   
breakpoints, 638     DAY 20   
code
side effects dependency, 541     DAY 17   
surrounding by #ifdef DEBUG and #endif, 530     DAY 17   
exceptions, 618-619     DAY 20   
catching, 624-627     DAY 20   
hiding versus overriding base class member functions,
levels of, 547-550     DAY 17   
memory
examining, 639     DAY 20   
leaks, 254-255     DAY 9    
multiple inheritance ambiguity, 383-388     DAY 13   
nested if statements, 75-76     DAY 4    
printing interim values, 546-547     DAY 17   
testing
with driver programs, 574-580     DAY 18   
with string substitution, 527-528     DAY 17   
viewing assembly code, 639     DAY 20   
watch points, 639     DAY 20   
wild (dangling/stray) pointers, 218-220     DAY 8    
decimal numbering system, 690   Appendix C 
declaring
arrays, 300, 307-308     DAY 11   
on free store, 314     DAY 11   
classes, 125-126, 133-134     DAY 6    
compiler errors, 141-144     DAY 6    
file locations, 144-145     DAY 6    
including simpler classes, 148-151     DAY 6    
coding styles for, 665     DAY 21   
forward, 474     DAY 15   
functions (prototyping), 87-90     DAY 5    
determining value-passing methods, 238-239     DAY 9    
multiple inheritance, 377-380     DAY 13   
pointers, 200-201     DAY 8    
structures, 151-152     DAY 6    
templates
for array classes, 587-589     DAY 19   
static members, 608-611     DAY 19   
decrement (--) operator, 62     DAY 4    
decrementing, 62-64     DAY 4    
deep copies, 271, 289     DAY 10   
default
case in switch statements, 180     DAY 7    
catch statement, 625     DAY 20   
constructors, 137-140, 267     DAY 6         DAY 10   
destructors, 137-140     DAY 6    
function parameter values, 102-104     DAY 5    
member function values, 264-266     DAY 10   
versus overloaded member functions, 266-267     DAY 10   
ofstream object arguments, changing, 515-517     DAY 16   
#define preprocessor directive, 48     DAY 3    
macros, 532-535     DAY 17   
string substitution, defining, 526-529     DAY 17   
defining
coding styles for, 665     DAY 21   
constants, 48-49     DAY 3    
functions, 87, 90-91     DAY 5    
member functions, 134-136     DAY 6    
objects, 127     DAY 6    
variables, 38-40     DAY 3    
local within blocks, 96-97     DAY 5    
multiple in single statements, 40     DAY 3    
delegation, 459     DAY 15   
versus implementing in terms of, 458-464     DAY 15   
delete keyword, 209-211     DAY 8    
deleting
arrays on free store, 316-317     DAY 11   
objects on free store, 212-213     DAY 8    
pointers, 209-211     DAY 8    
dereference (*) operator, 201-202     DAY 8    
derived classes, 339     DAY 12   
constructors, 344-350     DAY 12   
destructors, 344-350     DAY 12   
overriding base class member functions, 350-355     DAY 12   
protected access, 342-344     DAY 12   
deriving
ADTs (abstract data types) from other ADTs, 400-404     DAY 13   
exception hierarchies, 627-629     DAY 20   
design issues, 572-573     DAY 18   
destructors, 136-140     DAY 6    
copy, 242-245     DAY 9    
derived classes, 344-350     DAY 12   
virtual, 363     DAY 12   
development cycle, 12-13, 554     DAY 1         DAY 17   
condition objects, creating, 558     DAY 18   
data analysis, 563     DAY 18   
design issues, 572-573     DAY 18   
designing classes, 557-558, 564-566     DAY 18   
components, 570-572     DAY 18   
designing interfaces, 567-569     DAY 18   
driver programs, 574-580     DAY 18   
event loops for simulations, 558-560     DAY 18   
platform specifications, 561-562     DAY 18   
preliminary designs, 555-556     DAY 18   
problem space components, examining, 556-557     DAY 18   
simulations, 555     DAY 18   
direct recursion, 109     DAY 5    
directives, see preprocessor directives
division of integers, 60-61     DAY 4    
division operators
/ (division), 59     DAY 4    
/= (self-assigned), 62     DAY 4    
do...while loops, 168-170     DAY 7    
dot (member access) operator, 127     DAY 6    
double quote (\") escape character, 47     DAY 3    
double variables, 37     DAY 3    
doubly linked lists, 328     DAY 11   
driver programs, 574-580     DAY 18   
dynamic (run-time) binding, 359     DAY 12   

E


editors (text), requirements, 10-11     DAY 1    
else keyword, 70-72     DAY 4    
#else preprocessor directive, 528-529     DAY 17   
empty for loops, 175     DAY 7    
encapsulation, 8, 125, 486-487     DAY 6         DAY 16   
#endif preprocessor directive, 527     DAY 17   
endl manipulator, 23     DAY 2    
endless loops
for statements, 174     DAY 7    
switch statements, 183-186     DAY 7    
while statements, 165-167     DAY 7    
enum keyword, 49     DAY 3    
enumerated constants, 49-51     DAY 3    
EOF (end of file), 496     DAY 16   
eof() function, 513     DAY 16   
equals (==) operator, 66     DAY 4    
errors
compiler, 15     DAY 1    
class declarations, 141-144     DAY 6    
Member is ambiguous, 383     DAY 13   
exceptions versus assert() macro, 540-541     DAY 17   
fence post, 305     DAY 11   
linker, undefined symbol, 410     DAY 14   
logic, 616-617     DAY 20   
runtime
debugging, 638-639     DAY 20   
exceptions, see exceptions
escape characters, 46-47     DAY 3    
\0 (null), 317     DAY 11   
\n (new line), 21     DAY 2    
\t (tab), 23     DAY 2    
event loops, simulations, 558-560     DAY 18   
exceptions, 617-619     DAY 20   
catching, 624-627     DAY 20   
deriving, hierarchies, 627-629     DAY 20   
handling, 617     DAY 20   
objects, naming, 629-634     DAY 20   
raising, 619-623     DAY 20   
reading data from, 629-634     DAY 20   
try blocks, determining locations, 624     DAY 20   
versus assert() macro, 540-541     DAY 17   
when to use, 637-638     DAY 20   
with templates, 634-637     DAY 20   
exclusion guards, 529-532     DAY 17   
exclusive OR (^) operator, bitwise, 656     DAY 21   
executable files, creating, 12     DAY 1    
executing bodies of loops at least once, 168-170     DAY 7    
explicit implementations, templates, 602-608     DAY 19   
expressions, 57-58     DAY 4    
nesting parentheses, 65     DAY 4    
extracting from input
single characters, 496-498     DAY 16   
strings, 499-501     DAY 16   
extraction (>>) operator (overloaded), with cin objects, 496-501     DAY 16   

F


fail() function, 513     DAY 16   
false value, zero (0), 66     DAY 4    
in if statements, 78-79     DAY 4    
fence post errors, 305     DAY 11   
fib() function, 110-112     DAY 5    
Fibonacci number series
with loops, 177-180     DAY 7    
with recursion, 109-112     DAY 5    
fields, bit, 657-660     DAY 3         DAY 21   
__FILE__ macro, 538     DAY 17   
files
executable, creating, 12     DAY 1    
extensions
.C, 10, 144     DAY 1         DAY 6    
.CP, 10     DAY 1    
.CPP, 10, 144     DAY 1         DAY 6    
.H, 145     DAY 6    
.HP, 145     DAY 6    
.HPP, 145     DAY 6    
.OBJ, 12     DAY 1    
header, 144-145     DAY 6    
inclusion/exclusion guards, 529-532     DAY 17   
STRING.HPP, 453     DAY 15   
include, coding styles, 665     DAY 21   
input/output
binary versus text, 517-519     DAY 16   
reading from/writing to, 512-517     DAY 16   
object, 12     DAY 1    
fill() member function, 507-508     DAY 16   
filtering access to contained members, 454     DAY 15   
fin() function, 513     DAY 16   
flags (state)
ofstream objects, 513     DAY 16   
ostream, 506     DAY 16   
setting, 508-510     DAY 16   
flipping bits, 657     DAY 21   
float (floating point) variables, 36-37     DAY 3    
flush() member function, cout object, 504     DAY 16   
flushing buffers, 487-489     DAY 16   
output, 504     DAY 16   
for loops, 170-172     DAY 7    
empty, 175     DAY 7    
multiple initialization/increment statements, 172-173     DAY 7    
nesting, 175-177     DAY 7    
null statements, 173-174     DAY 7    
process sequence, 172     DAY 7    
scoping in, 177     DAY 7    
forever loops
for statements, 174     DAY 7    
switch statements, 183-186     DAY 7    
while statements, 165-167     DAY 7    
formatting output
fill characters, 507-508     DAY 16   
widths, 506-507     DAY 16   
formatting codes, see escape characters
forward declarations, 474     DAY 15   
fout() function, 513     DAY 16   
free store, 207-208     DAY 8    
allocating memory on, 208-209     DAY 8    
arrays on
declaring, 314     DAY 11   
deleting, 316-317     DAY 11   
objects
accessing members, 213-214     DAY 8    
creating, 212-213     DAY 8    
deleting, 212-213     DAY 8    
pointers as members, 215-216     DAY 8    
pointing to individual objects, 216-217     DAY 8    
pointer ownership, 256     DAY 9    
reassigning pointers before restoring memory, 211-212     DAY 8    
restoring memory to, 209-211     DAY 8    
friend
classes, 468-475     DAY 15   
functions, 475-480     DAY 15   
types, templates, 593-599     DAY 19   
fstream classes, 490     DAY 16   
FUNC.CPP program, 28-29     DAY 2    
functions, 12, 26-29, 86-87     DAY 1         DAY 2         DAY 5    
Add(), 284-285     DAY 10   
arguments, 98     DAY 5    
passing by reference, 234-238     DAY 9    
passing by value, 98-100     DAY 5    
atoi(), 651-652     DAY 21   
bad(), 513     DAY 16   
close(), 513     DAY 16   
ctime(), 650-651     DAY 21   
declaring (prototyping), 87-90     DAY 5    
coding styles for, 665     DAY 21   
determining value-passing methods, 238-239     DAY 9    
defining, 87, 90-91     DAY 5    
coding styles for, 665     DAY 21   
eof(), 513     DAY 16   
executing, 91     DAY 5    
fail(), 513     DAY 16   
fib(), 110-112     DAY 5    
fin(), 513     DAY 16   
fout(), 513     DAY 16   
friend, 475-480     DAY 15   
template class declarations, 593-599     DAY 19   
good(), 513     DAY 16   
header contents, 238-239     DAY 9    
Increment(), 275-276     DAY 10   
inline, 107-109, 535-536     DAY 5         DAY 17   
local variables, 92-94     DAY 5    
comparing with global variables, 94-95     DAY 5    
defining within blocks, 96-97     DAY 5    
localtime(), 650-651     DAY 21   
main(), 21     DAY 2    
member, see member functions
overloading, 104-107     DAY 5    
parameters, 92-94     DAY 5    
default values, 102-104     DAY 5    
passing
pointers to functions to, 423-424     DAY 14   
template objects to and from, 599-602     DAY 19   
percolating up into base classes, 374     DAY 13   
pointers to, 415-426     DAY 14   
qsort(), 652-654     DAY 21   
read(), 517     DAY 16   
recursive, 109-112     DAY 5    
return values, 100-101     DAY 5    
multiple, 239-242     DAY 9    
signatures, 350     DAY 12   
sizeof(), 36, 518     DAY 3         DAY 16   
statements in, 97     DAY 5    
strcat(), 648-649     DAY 21   
strcpy(), 319-321, 645-648     DAY 11        DAY 21   
strlen(), 644-645     DAY 21   
strncat(), 648-649     DAY 21   
strncpy(), 320-321, 646-648     DAY 11        DAY 21   
swap(), 99-100, 236-238     DAY 5         DAY 9    
template, 592-593     DAY 19   
time(), 650-651     DAY 21   
versus macros, 535     DAY 17   
virtual
in exceptions, 632-634     DAY 20   
pure, 396-400     DAY 13   

G


games, small/large numbers, 161-162     DAY 7    
with target number for large, 163-165     DAY 7    
get() member function, of cin object, 319, 496-501     DAY 11        DAY 16   
getline() member function, of cin object, 500-501     DAY 16   
gigabytes, 694   Appendix C 
global variables
comparing with local variables, 94-95     DAY 5    
disadvantages, 95     DAY 5    
good() function, 513     DAY 16   
goto statements, 158-160     DAY 7    
greater than (>) operator, 67     DAY 4    
greater than or equals (>=) operator, 67     DAY 4    

H


.H file extension, 145     DAY 6    
head node, 328     DAY 11   
header files, 144-145     DAY 6    
CAT.HPP, 146     DAY 6    
inclusion/exclusion guards, 529-532     DAY 17   
program text, coding styles, 662     DAY 21   
RECTANGLE.HPP, 148-149     DAY 6    
headers
comments, 25-26     DAY 2    
for loops, containing action statements, 175     DAY 7    
functions, 27-28, 90     DAY 2         DAY 5    
contents, 238-239     DAY 9    
heap, see free store
HELLO.CPP (Hello World) program, 13-15, 20-21     DAY 1         DAY 2    
HELP.CPP program, 24     DAY 2    
hexadecimal numbering system, 694-697   Appendix C 
hiding
base class member functions, 352-353     DAY 12   
data, 8     DAY 1    
hierarchies
exceptions, deriving, 627-629     DAY 20   
inheritance, rooted versus non-rooted, 565-566     DAY 18   
.HP file extension, 145     DAY 6    
.HPP (header) file extension, 145     DAY 6    

I


I/O (input/output)
command-line processing, 519-522     DAY 16   
files, 512-517     DAY 16   
binary versus text, 517-519     DAY 16   
input
extracting single characters, 496-498     DAY 16   
ignoring remaining characters, 501-503     DAY 16   
inserting characters, 503-504     DAY 16   
single characters, 496     DAY 16   
strings, 499-501     DAY 16   
viewing next characters, 503-504     DAY 16   
output
cout streams versus printf() statement, 510-512     DAY 16   
flushing buffers, 504     DAY 16   
formatting widths, 506-507     DAY 16   
formatting with fill characters, 507-508     DAY 16   
printing to screen, 21-23     DAY 2    
writing single characters to, 504-505     DAY 16   
writing strings to, 505-506     DAY 16   
redirection, 491     DAY 16   
standard objects, 490     DAY 16   
cin, 491-496     DAY 16   
cout, 496-506     DAY 16   
state flags
ofstream objects, 513     DAY 16   
setting, 508-510     DAY 16   
identifiers, coding styles, 662-663     DAY 21   
if statements, 67-69     DAY 4    
aligning braces, 70     DAY 4    
else keyword, 70-72     DAY 4    
nested, 72-74     DAY 4    
braces with, 74-76     DAY 4    
zero (false)/nonzero (true) values, 78-79     DAY 4    
#ifdef preprocessor directive, 527-528     DAY 17   
#ifndef preprocessor directive, 527-528     DAY 17   
ignore() member function, 501-503     DAY 16   
implementations, 134-136     DAY 6    
file locations, 144-145     DAY 6    
inheriting, 464-468     DAY 15   
inline, 145-147     DAY 6    
pure virtual functions, 397-400     DAY 13   
templates
explicit, 602-608     DAY 19   
for array classes, 589-592     DAY 19   
implementing in terms of, 459     DAY 15   
versus delegation, 458-464     DAY 15   
implicit casting, 327     DAY 11   
#include directive, 20-21     DAY 2    
coding styles, 665     DAY 21   
inclusion guards, 529-532     DAY 17   
increment (++) operator, 62     DAY 4    
overloading
postfix, 282-284     DAY 10   
prefix, 276-278     DAY 10   
returning
temporary objects, 278-280     DAY 10   
this pointer, 281-282     DAY 10   
increment statements, 171     DAY 7    
multiple in for loops, 172-173     DAY 7    
Increment() function, 275-276     DAY 10   
incrementing, 62-64     DAY 4    
indenting
if statements, 70     DAY 4    
switch statements, coding styles, 661     DAY 21   
tabs, coding styles, 660     DAY 21   
index ([]) operator, 308     DAY 11   
indirect recursion, 109     DAY 5    
indirection, 201     DAY 8    
indirection (*) operator, 201-202     DAY 8    
inheritance, 8     DAY 1    
hierarchies, rooted versus non-rooted, 565-566     DAY 18   
multiple, 377-393     DAY 13   
private, 464-468     DAY 15   
public
components, 338-342     DAY 12   
constructors/destructors, 344-350     DAY 12   
overriding base class member functions, 350-355     DAY 12   
protected access, 342-344     DAY 12   
single, disadvantages, 372-377     DAY 13   
virtual, 388-391     DAY 13   
initialization statements, 171     DAY 7    
multiple in for loops, 172-173     DAY 7    
initializing
arrays, 305-306     DAY 11   
multidimensional, 310-312     DAY 11   
base classes, 346-350     DAY 12   
objects, 269-270     DAY 10   
pointers, 200-201     DAY 8    
variables, 41-42     DAY 3    
inline functions, 107-109, 535-536     DAY 5         DAY 17   
inline implementation, 145-147     DAY 6    
insertion (<<) operator
as friend function, 596-599     DAY 19   
overloading, 478-480     DAY 15   
with cout object, 504     DAY 16   
instantiation, 587     DAY 19   
int (integer) variables, 37     DAY 3    
assigning values/initializing, 40-42     DAY 3    
memory size, 35     DAY 3    
short versus long, 43-45     DAY 3    
integers
converting ASCII to, 651-652     DAY 21   
division, 60-61     DAY 4    
interfaces
designing, 567-569     DAY 18   
see also declaring
intermediate files
creating, 526     DAY 17   
viewing, 526     DAY 17   
interpreters, 5     DAY 1    
invariants, classes, 541-546     DAY 17   
ios class, 490     DAY 16   
iostream
class, 490     DAY 16   
library, 486     DAY 16   
objects, state flags, 508-510     DAY 16   
is-a relationships, 458     DAY 15   
istream
class, 490     DAY 16   
objects, references to, 496     DAY 16   
iteration, see loops

J-K


jumping with goto, 158-160     DAY 7    
K (kilobyte), 694   Appendix C 
keywords, 40     DAY 3    
class, 125     DAY 6    
const, 48-49, 140     DAY 3         DAY 6    
delete, 209-211     DAY 8    
else, 70-72     DAY 4    
enum, 49     DAY 3    
for, 171     DAY 7    
friend, 468     DAY 15   
inline, 107     DAY 5    
listing of, 688   Appendix B 
new, 208-209     DAY 8    
operator, 283     DAY 10   
private, 129     DAY 6    
protected, 342     DAY 12   
public, 129     DAY 6    
struct, 151     DAY 6    
template, 587     DAY 19   
typedef (type definition), 42-43     DAY 3    
kilobytes (K), 694   Appendix C 
kludges, 168     DAY 7    

L


labels, 158     DAY 7    
less than (<) operator, 67     DAY 4    
less than or equals (<=) operator, 67     DAY 4    
libraries, 12, 486     DAY 1         DAY 16   
buying, versus writing routines, 568     DAY 18   
iostream, 486     DAY 16   
standard, 644     DAY 21   
stdlib, 651-654     DAY 21   
string, 644-649     DAY 21   
time, 650-651     DAY 21   
__LINE__ macro, 538     DAY 17   
lines of code, coding styles for lengths, 661     DAY 21   
linked lists, 327-333     DAY 11   
linker errors, undefined symbol, 410     DAY 14   
listings
1.1. HELLO.CPP the Hello World program, 14     DAY 1    
1.2. Demonstration of compiler error, 15     DAY 1    
2.1. HELLO.CPP. Demonstrates the parts of a C++ program, 20     DAY 2    
2.2. Using cout, 22     DAY 2    
2.3. HELP.CPP demonstrates comments, 24     DAY 2    
2.4. Demonstrating a call to a function, 27     DAY 2    
2.5. FUNC.CPP demonstrates a simple function, 28-29     DAY 2    
3.1. Determines the size of variable types on your computer, 35     DAY 3    
3.2. Demonstrates the use of variables, 41     DAY 3    
3.3. Demonstrates typedef, 42-43     DAY 3    
3.4. Demonstrates putting too large a value in an unsigned integer, 44     DAY 3    
3.5. Demonstrates adding too large a number to a signed integer, 44-45     DAY 3    
3.6. Printing characters based on numbers, 46     DAY 3    
3.7. Demonstrates enumerated constants, 50     DAY 3    
4.1. Evaluating complex expressions, 58     DAY 4    
4.2. Demonstrates subtraction and integer overflow, 60     DAY 4    
4.3. Demonstrates prefix and postfix operators, 63     DAY 4    
4.4. Demonstrates branching based on relational operators, 68-69     DAY 4    
4.5. Demonstrating the else keyword, 71     DAY 4    
4.6. A complex, nested if statement, 73     DAY 4    
4.7. Demonstrates why braces help clarify which else statments, 74     DAY 4    
4.8. Demonstrates the proper use of braces with an if statement, 75     DAY 4    
4.9. Demonstrates the conditional operator, 80     DAY 4    
5.1. Shows a function declaration and the definition / use of that function, 89     DAY 5    
5.2. Demonstrates use of local variables and parameters, 92     DAY 5    
5.3. Demonstrating global and local variables, 94     DAY 5    
5.4. Demonstrates variables scoped within a block, 96     DAY 5    
5.5. Demonstrates passing by value, 99     DAY 5    
5.6. Demonstrates multiple return statements, 100-101     DAY 5    
5.7. Demonstrates default parameter values, 103     DAY 5    
5.8. Demonstrates function polymorphism, 105-106     DAY 5    
5.9. Demonstrates an inline function, 108     DAY 5    
5.10. Demonstrates recursion using the Fibonacci series, 110-111     DAY 5    
6.1. Accessing the public members of a simple class, 130     DAY 6    
6.2. A class with accessor methods, 131-132     DAY 6    
6.3. Implementing the methods of a simple class, 134-135     DAY 6    
6.4. Using constructors and destructors, 138-139     DAY 6    
6.5. A demonstration of violations of the interface, 142-143     DAY 6    
6.6. Cat class declaration in CAT.HPP, 146     DAY 6    
6.7. Cat implementation in CAT.CPP, 146-147     DAY 6    
6.8. Declaring a complete class, 148-149     DAY 6    
6.9. RECTANGLE.CPP, 149-150     DAY 6    
7.1. Looping with the keyword goto, 158     DAY 7    
7.2. while loops, 160     DAY 7    
7.3. Complex while loops, 161-162     DAY 7    
7.4. Break and continue, 163-164     DAY 7    
7.5. while (1) loops, 166     DAY 7    
7.6. Skipping the body of the while loop, 167     DAY 7    
7.7. Demonstrates do...while loop, 168     DAY 7    
7.8. While reexamined, 170     DAY 7    
7.9. Demonstrating the for loop, 171     DAY 7    
7.10. Demonstrating multiple statements in for loops, 172-173     DAY 7    
7.11. Null statements in for loops, 173     DAY 7    
7.12. Illustrating empty for loop statement, 174     DAY 7    
7.13. Illustrates null statement in for loop, 175     DAY 7    
7.14. Illustrates nested for loops, 176     DAY 7    
7.15. Solving the Nth Fibonnacci number using iteration, 178     DAY 7    
7.16. Demonstrating the switch statement, 181     DAY 7    
7.17. Illustrates a forever loop, 183-185     DAY 7    
8.1. Demonstrating address of variables, 199     DAY 8    
8.2. Manipulating data by using pointers, 203-204     DAY 8    
8.3. Finding out what is stored in pointers, 205     DAY 8    
8.4. Allocating, using, and deleting pointers, 210     DAY 8    
8.5. Creating and deleting objects on the free store, 212-213     DAY 8    
8.6. Accessing member data of objects on the free store, 214     DAY 8    
8.7. Pointers as member data, 215     DAY 8    
8.8. Using the this pointer, 216-217     DAY 8    
8.9. Using a stray pointer, 218     DAY 8    
8.10. Using pointers to const objects, 221-222     DAY 8    
9.1. Creating and using references, 229     DAY 9    
9.2. Taking the address of a reference, 230     DAY 9    
9.3. Assigning to a reference, 231     DAY 9    
9.4. References to objects, 233     DAY 9    
9.5 (5.5). Demonstrating pass by value, 235     DAY 9    
9.6. Passing by reference using pointers, 236     DAY 9    
9.7. Swap rewritten with references, 237     DAY 9    
9.8. Returning values with pointers, 239-240     DAY 9    
9.9. Listing 9.8 rewritten using references, 241-242     DAY 9    
9.10. Passing objects by reference, 243-244     DAY 9    
9.11. Passing const pointers, 245-247     DAY 9    
9.12. Passing references to objects, 248-249     DAY 9    
9.13. Returning a reference to a non-existent object,  252-253     DAY 9    
9.14. Memory leaks, 254     DAY 9    
10.1. Illustrates overloading member functions, 262-26     DAY 10   
10.2. Using default values, 264-265     DAY 10   
10.3. Overloading the constructor, 267-268     DAY 10   
10.4. A code snippet showing initialization of member variables, 269-270     DAY 10   
10.5. Copy constructors, 271-272     DAY 10   
10.6. The Counter class, 274-275     DAY 10   
10.7. Adding an increment operator, 275-276     DAY 10   
10.8. Overloading operator++, 277     DAY 10   
10.9. Returning a temporary object, 278-279     DAY 10   
10.10. Returning a nameless temporary object, 279-280     DAY 10   
10.11. Returning the this pointer, 281     DAY 10   
10.12. Prefix and postfix operators, 282-283     DAY 10   
10.13. The Add() function, 284-285     DAY 10   
10.14. operator+, 286     DAY 10   
10.15. An assignment operator, 289-290     DAY 10   
10.16. Attempting to assign a counter to a USHORT, 291-292     DAY 10   
10.17. Converting USHORT to Counter, 292-293     DAY 10   
10.18. Converting from Counter to unsigned short(), 293-294     DAY 2    
11.1. Using an integer array, 301     DAY 11   
11.2. Writing past the end of an array, 303     DAY 11   
11.3. Using consts and enums in arrays, 307     DAY 11   
11.4. Creating an array of objects, 308-309     DAY 11   
11.5. Creating a multidimensional array, 311     DAY 11   
11.6. Storing an array on the free store, 313     DAY 11   
11.7. Creating an array by using new, 315-316     DAY 11   
11.8. Filling an array, 318     DAY 11   
11.9. Filling an array, 319     DAY 11   
11.10. Using strcpy(), 320     DAY 11   
11.11. Using strncpy(), 320     DAY 11   
11.12. Using a String class, 321-324     DAY 11   
11.13. Implementing a linked list, 329-331     DAY 11   
12.1. Simple inheritance, 340-341     DAY 12   
12.2. Using a derived object, 343     DAY 12   
12.3. Constructors and destructors called, 344-345     DAY 12   
12.4. Overloading constructors in derived classes, 346-348     DAY 12   
12.5. Overriding a base class method in a derived class, 350-351     DAY 12   
12.6. Hiding methods, 352-353     DAY 12   
12.7. Calling base method from overridden method, 354     DAY 12   
12.8. Using virtual methods, 356     DAY 12   
12.9. Multiple virtual functions called in turn, 357-358     DAY 12   
12.10. Data slicing when passing by value, 361-362     DAY 12   
12.11. Virtual copy constructor, 364-365     DAY 12   
13.1. If horses could fly, 373-374     DAY 13   
13.2. Run time type identification, 375-376     DAY 13   
13.3. Multiple inheritance, 377-379     DAY 13   
13.4. Calling multiple constructors, 381-382     DAY 13   
13.5. Common base classes, 385-386     DAY 13   
13.6. Illustrates use of virtual inheritance, 389-390     DAY 13   
13.7. Shape classes, 393-395     DAY 13   
13.8. Abstract data types, 396     DAY 13   
13.9. Implementing pure virtual functions, 398-400     DAY 13   
13.10. Deriving ADTs from other ADTs, 401-403     DAY 13   
14.1. Static member data, 408-409     DAY 14   
14.2. Accessing static members without an object, 410-411     DAY 14   
14.3. Accessing static members using non-static member functions, 412     DAY 14   
14.4. Static member functions, 413-414     DAY 14   
14.5. Pointers to functions, 416-417     DAY 14   
14.6. Rewriting 14.5 without the pointer to functions, 419-420     DAY 14   
14.7. Demonstrates use of an array of pointers to functions, 421-422     DAY 14   
14.8. Passing pointers to functions as function argumement, 423-424     DAY 14   
14.9. Using typedef to make pointers to functions more readable, 425     DAY 14   
14.10. Pointers to member functions, 426-428     DAY 14   
14.11. Array of pointers to member functions, 429-430     DAY 14   
15.1. The String class, 448-451     DAY 15   
15.2. The Employee class and driver program, 451-453     DAY 15   
15.3. Contained class constructors, 455     DAY 15   
15.4. Passing by value, 457     DAY 15   
15.5. Delegating to a contained linked list, 459-463     DAY 15   
15.6. Private inheritance, 465-466     DAY 15   
15.7. Friend class illustrated, 469-473     DAY 15   
15.8. Friendly operator+, 476-477     DAY 15   
15.9. Overloading operator<<(), 479     DAY 15   
16.1. cin handles different data types, 492     DAY 16   
16.2. Trying to write more than one word to cin, 493     DAY 16   
16.3. Multiple input, 494-495     DAY 16   
16.4. Using get() with no parameters, 497     DAY 16   
16.5 Using get() with parameters, 498     DAY 16   
16.6. Using get() with a character array, 499     DAY 16   
16.7. Using getline(), 500     DAY 16   
16.8. Using ignore(), 502     DAY 16   
16.9. Using peek() and putback(), 503     DAY 16   
16.10. Using put(), 505     DAY 16   
16.11. Using write(), 505     DAY 16   
16.12. Adjusting the width of output, 507     DAY 16   
16.13. Using fill(), 508     DAY 16   
16.14. Using setf, 509     DAY 16   
16.15. Printing with printf(), 511     DAY 16   
16.16. Opening files for read and write, 513-514     DAY 16   
16.17. Appending to the end of a file, 515-516     DAY 16   
16.18. Writing a class to a file, 518-519     DAY 16   
16.19. Using command-line arguments, 520     DAY 16   
16.20. Using command-line arguments, 521     DAY 16   
17.1. Using #define, 528     DAY 17   
17.2. Using #undef, 531     DAY 17   
17.3. Using parentheses in macros, 534     DAY 17   
17.4. Using inline rather than a macro, 536     DAY 17   
17.5. A simple assert() macro, 539     DAY 17   
17.6. Using Invariants(), 542-545     DAY 17   
17.7. Printing values in DEBUG mode, 546-547     DAY 17   
17.8. Levels of debugging, 547-549     DAY 17   
18.1. A simple event loop, 558-560     DAY 18   
18.2. PostMasterMessage's interface, 570-571     DAY 18   
18.3. A driver program for PostMasterMessage, 574-579     DAY 18   
19.1. A template of an array class, 588     DAY 19   
19.2. The implementation of the template array, 590-59     DAY 19   
19.3. Non-template friend function, 594-595     DAY 19   
19.4. Using operator ostream, 596-597     DAY 19   
19.5. Passing template objects to and from functions, 599-601     DAY 19   
19.6. Specializing template implementations, 603-606     DAY 19   
19.7. Using static member data and functions with templates, 608-610     DAY 19   
20.1. Raising an exception, 620-622     DAY 20   
20.2. Multiple exceptions, 625-626     DAY 20   
20.3. Class hierarchies and exceptions, 627-628     DAY 20   
20.4. Getting data out of an exception object, 629-631     DAY 20   
20.5. Passing by reference and using virtual functions, 632-634     DAY 20   
20.6. Using exceptions with templates, 635-637     DAY 20   
21.1. strlen(), 644-645     DAY 21   
21.2. Using strcpy(), 645-646     DAY 21   
21.3. Using strncpy(), 647     DAY 21   
21.4. Using strcat() and strncat(), 648-649     DAY 21   
21.5. Using ctime(), 650     DAY 21   
21.6. Using atoi() and related functions, 651     DAY 21   
21.7. Using qsort(), 653     DAY 21   
21.8. Using bit fields, 658-659     DAY 21   
lists
adding objects to two in single inheritance, 377     DAY 13   
linked, 327-333     DAY 11   
literal constants, 47     DAY 3    
local variables, 92-94     DAY 5    
arguments passed by value, 98-100     DAY 5    
comparing with global variables, 94-95     DAY 5    
defining within blocks, 96-97     DAY 5    
localtime() function, 650-651     DAY 21   
logic errors, 616-617     DAY 20   
logical operators, 76-77     DAY 4    
order of precedence, 77-78     DAY 4    
with while loops, 161-162     DAY 7    
long int (integer) variables, 37     DAY 3    
size, 35     DAY 3    
long variables versus short variables, 43-45     DAY 3    
loops
do...while, 168-170     DAY 7    
event, 558-560     DAY 18   
Fibonacci number series, 177-180     DAY 7    
for, 170-177     DAY 7    
forever, 165-167, 174, 183-186     DAY 7    
goto, 158-160     DAY 7    
while, 160-167     DAY 7    

M


M (megabyte), 694   Appendix C 
Macintosh source materials, 668     DAY 21   
macros
assert(), 538-550     DAY 17   
coding styles, 666     DAY 21   
creating, 532-533     DAY 17   
manipulating strings, 537-538     DAY 17   
parentheses in, 533-535     DAY 17   
predefined, 538     DAY 17   
versus functions/templates, 535     DAY 17   
magazines, 668     DAY 21   
main() function, 21     DAY 2    
manipulators
endl, 23     DAY 2    
setw, 509     DAY 16   
mathematical operators, 59-61     DAY 4    
combining with assignment operator, 61-62     DAY 4    
order of precedence, 64     DAY 4    
megabytes (M), 694   Appendix C 
member access (.) operator, 127     DAY 6    
Member is ambiguous compiler error, 383     DAY 13   
members of classes
accessing, 127-128     DAY 6    
of contained classes, 454     DAY 15   
functions, 125     DAY 6    
accessor, 131-132     DAY 6    
const, 140-141     DAY 6    
constructors, 136-140     DAY 6    
default values, 264-266     DAY 10   
destructors, 136-140     DAY 6    
fill(), 507-508     DAY 16   
flush(), cout, 504     DAY 16   
get(), cin, 319, 496-501     DAY 11        DAY 16   
getline(), cin, 500-501     DAY 16   
ignore(), 501-503     DAY 16   
implementations (definitions), 134-136, 144-147     DAY 6    
naming, 126     DAY 6    
of base classes, overriding, 350-355     DAY 12   
overloading, 262-264, 266-267     DAY 10   
parameters, pointing to individual objects, 216-217     DAY 8    
peek(), cin, 503-504     DAY 16   
pointers to, 426-430     DAY 14   
put(), cout, 504-505     DAY 16   
putback(), cin, 503-504     DAY 16   
setf(), cout, 508-510     DAY 16   
static, 413-415     DAY 14   
virtual, 355-367     DAY 12   
width(), cout, 506-507     DAY 16   
write(), cout, 505-506     DAY 16   
private versus public, 129-134     DAY 6    
templates, declaring static, 608-611     DAY 19   
variables, 125     DAY 6    
declaring/adding two, 284-287     DAY 10   
initializing, 269-270     DAY 10   
naming, 126     DAY 6    
static, 408-413     DAY 14   
memory
addresses, obtaining, 198-200     DAY 8    
allocating on free store, 208-209     DAY 8    
examining, 639     DAY 20   
RAM (random access memory), 34     DAY 3    
restoring to free store, 209-211     DAY 8    
stack, optimizing usage, 312-314     DAY 11   
variable divisions, 35     DAY 3    
memory leaks, 209, 211-212, 254-255     DAY 8         DAY 9    
menus, selecting commands with forever loops, 183-186     DAY 7    
methods, see members of classes, functions
Mixins (capability classes), 392-393     DAY 13   
modulus operators
% (modulus), 59-60     DAY 4    
%= (self-assigned), 62     DAY 4    
multidimensional arrays, 309-310     DAY 11   
initializing, 310-312     DAY 11   
multiple
catch statements, 625-627     DAY 20   
initialization/increment statements in for loops, 172-     DAY 7    
inheritance
ambiguity, 383-384, 384-388     DAY 13   
constructors, 381-383     DAY 13   
declaring, 377-380     DAY 13   
disadvantages, 391-392     DAY 13   
Mixins (capability classes), 392-393     DAY 13   
virtual inheritance, 388-391     DAY 13   
platforms, conditional compiling for, 532     DAY 17   
values, returning, 239-242     DAY 9    
variables, defining in single statements, 40     DAY 3    
multiplication operators
* (multiplication), 59     DAY 4    
*= (self-assigned), 62     DAY 4    

N


names
arrays, as pointers, 315-316     DAY 11   
capitalization/spelling, coding styles, 663-664     DAY 21   
classes, 126     DAY 6    
exception objects, 629-634     DAY 20   
member functions, 126     DAY 6    
member variables, 126     DAY 6    
pointers, 201     DAY 8    
templates for array classes, 589     DAY 19   
nesting
for loops, 175-177     DAY 7    
if statements, 72-74     DAY 4    
braces with, 74-76     DAY 4    
parentheses, 65     DAY 4    
new keyword, 208-209     DAY 8    
new line (\n) escape character, 47     DAY 3    
nodes, 328     DAY 11   
non-rooted inheritance hierarchies versus rooted inheritance, 565-566     DAY 18   
nonzero true values, 66     DAY 4    
in if statements, 78-79     DAY 4    
not equals (!=) operator, 67     DAY 4    
NOT (!) operator (logical), 76-77     DAY 4    
null (\0) character, 317     DAY 11   
null objects, 234     DAY 9    
null statements, 56     DAY 4    
in for loops, 173-174     DAY 7    
numbering array elements, 302     DAY 11   
numbering systems
binary, 692-694   Appendix C 
converting between bases, 691-692   Appendix C 
decimal, 690   Appendix C 
hexadecimal, 694-697   Appendix C 
octal, 690-691   Appendix C 
setting for display, 508     DAY 16   
numbers
as characters, 46     DAY 3    
Fibonacci series
with loops, 177-180     DAY 7    
with recursion, 109-112     DAY 5    
small/large games, 161-162     DAY 7    
with target number for large, 163-165     DAY 7    
subtracting large from small, 59-60     DAY 4    
nybbles, 693   Appendix C 

O


.OBJ file extension, 12     DAY 1    
object files, 12     DAY 1    
object-oriented
analysis and design
data analysis, 563     DAY 18   
design issues, 572-573     DAY 18   
designing classes, 564-566, 570-572     DAY 18   
designing interfaces, 567-569     DAY 18   
development cycle, 554
driver programs, 574-580     DAY 18   
platform specifications, 561-562     DAY 18   
project subdivision, 562-563     DAY 18   
simulations, 555-560     DAY 18   
source material, 667     DAY 21   
programming
source material, 667     DAY 21   
versus structured programming, 6-7     DAY 1    
objects
adding to two lists in single inheritance, 377     DAY 13   
arrays of, 308-309     DAY 11   
casting down, 375-376     DAY 13   
condition, creating during program design, 558     DAY 18   
const
pointers to, 221-222     DAY 8    
this pointers to, 222-223     DAY 8    
cout, 21-23     DAY 2    
defining, 127     DAY 6    
determining during program design, 556-557     DAY 18   
initializing, 269-270     DAY 10   
iostream, state flags, 508-510     DAY 16   
istream, references to, 496     DAY 16   
members
accessing, 127-128     DAY 6    
pointers as, 215-216     DAY 8    
null, 234     DAY 9    
ofstream, 512-517     DAY 16   
on free store
accessing members, 213-214     DAY 8    
creating, 212-213     DAY 8    
deleting, 212-213     DAY 8    
returning references to, 253-255     DAY 9    
ostream, references to, 504-506     DAY 16   
passing pointers to, 242-245     DAY 9    
passing references to, 247-249     DAY 9    
references, 232-234     DAY 9    
returning references to, non-existent objects, 252-253     DAY 9    
standard I/O (input/output), 490     DAY 16   
cin, 491-496     DAY 16   
cout, 496-506     DAY 16   
template, passing to and from functions, 599-602     DAY 19   
temporary, returning in overloaded operator functions,
versus classes, 127     DAY 6    
octal numbering system, 690-691   Appendix C 
ofstream objects, 512-517     DAY 16   
opening files for input/output, 513-514     DAY 16   
operators, 59     DAY 4    
# (stringizing), 537     DAY 17   
## (concatenation), 537-538     DAY 17   
% (modulus), 60     DAY 4    
& (address of), with references, 229-232     DAY 9    
& (reference), 228     DAY 9    
* (indirection), 201-202     DAY 8    
+ (addition), overloading, 286-287     DAY 10   
++ (increment), 62     DAY 4    
overloading postfix, 282-284     DAY 10   
overloading prefix, 276-278     DAY 10   
returning temporary objects, 278-280     DAY 10   
returning this pointer, 281-282     DAY 10   
-- (decrement), 62     DAY 4    
. (member access), 127     DAY 6    
<< (insertion)
as friend function, 596-599     DAY 19   
overloaded, with cout object, 504     DAY 16   
= (assignment), 40, 59     DAY 3         DAY 4    
combining with mathematical operators, 61-62     DAY 4    
overloading, 288-291     DAY 10   
>> (extraction), overloaded, with cin object, 496     DAY 16   
?: (conditional) ternary, 79-80     DAY 4    
[ ] (index), 308     DAY 11   
bitwise, 655-656     DAY 21   
conversion, 291-294     DAY 10   
logical, 76-77     DAY 4    
with while loops, 161-162     DAY 7    
mathematical, 59-61     DAY 4    
order of precedence, 686   Appendix A 
mathematical, 64     DAY 4    
relational/logical, 77-78     DAY 4    
overloading
friend functions, 475-480     DAY 15   
rules, 287-288     DAY 10   
postfix, 62-64     DAY 4    
overloading, 282-284     DAY 10   
prefix, 62-64     DAY 4    
relational, 66-67     DAY 4    
self-assigned, 62     DAY 4    
subscript, 308, 314     DAY 11   
OR operators
| (bitwise), 655     DAY 21   
|| (logical), 76-77     DAY 4    
^ (bitwise exclusive), 656     DAY 21   
order of precedence, operators, 686   Appendix A 
mathematical, 64     DAY 4    
relational/logical, 77-78     DAY 4    
ostream
class, 490     DAY 16   
objects, references to, 504-506     DAY 16   
state flags, 506     DAY 16   
output, see I/O
overloading
+ (addition) operator, 286-287     DAY 10   
++ (increment) operator
postfix, 282-284     DAY 10   
prefix, 276-278     DAY 10   
returning temporary objects, 278-280     DAY 10   
returning this pointer, 281-282     DAY 10   
<< (insertion) operator, with cout object, 504     DAY 16   
= (assignment) operator, 288-291     DAY 10   
>> (extraction) operator, with cin object, 496-501     DAY 16   
constructors, 267-269     DAY 10   
in base classes, 346-350     DAY 12   
member functions, 262-264     DAY 10   
versus default values, 266-267     DAY 10   
operators
friend functions, 475-480     DAY 15   
postfix, 282-284     DAY 10   
prefix, 276-278     DAY 10   
rules, 287-288     DAY 10   
versus overriding, 352     DAY 12   
overloading functions, 104-107     DAY 5    
overriding base class member functions, 350-355     DAY 12   

P


parameterized array classes, 586-587     DAY 19   
parameters
functions, 27-28, 92-94     DAY 2         DAY 5    
default values, 102-104     DAY 5    
member functions, pointing to individual objects, 216-     DAY 8    
parentheses
in macros, 533-535     DAY 17   
nesting, 65     DAY 4    
parsing strings, 504     DAY 16   
passing
by reference
comparing with passing by value, 242-249     DAY 9    
function argument values, 234-238     DAY 9    
in exceptions, 632-634     DAY 20   
by value, function arguments, 98-100     DAY 5    
contained-class objects, 456-458     DAY 15   
pointers to functions to other functions, 423-424     DAY 14   
template objects to and from functions, 599-602     DAY 19   
values, determining method used, 238-239     DAY 9    
peek() member function, cin object, 503-504     DAY 16   
piping input/output, 491     DAY 16   
platform specifications, developing, 561-562     DAY 18   
platform-independent languages, 486     DAY 16   
pointers, 198     DAY 8    
array names as, 315-316     DAY 11   
arrays of, 312-314     DAY 11   
versus pointers to arrays, 314-315     DAY 11   
as object members, 215-216     DAY 8    
checking addresses, 204-206     DAY 8    
combining with references, 250-252     DAY 9    
const, 220-221     DAY 8    
passing to objects, 245-247     DAY 9    
creating, 208-209     DAY 8    
declaring/initializing, 200-201     DAY 8    
deleting, 209-211     DAY 8    
dereferencing, 201-202     DAY 8    
free store, 207-208     DAY 8    
manipulating variable values, 203-204     DAY 8    
names, 201     DAY 8    
objects on free store
accessing members, 213-214     DAY 8    
creating/deleting, 212-213     DAY 8    
ownership, 256     DAY 9    
passing
by reference, 236-237     DAY 9    
to objects, 242-245     DAY 9    
reassigning before deleting pointed-to memory, 211-212     DAY 8    
returning multiple function values, 239-241     DAY 9    
stomping on, 219     DAY 8    
this, 216-217     DAY 8    
returning in overloaded operator functions, 281-282     DAY 10   
to const objects, 222-223     DAY 8    
to const objects, 221-222     DAY 8    
to functions, 415-426     DAY 14   
to member functions, 426-430     DAY 14   
uses, 206-207     DAY 8    
versus
addresses versus variable values, 202-203     DAY 8    
references, 249-250     DAY 9    
v-ptrs (v-pointers/virtual table pointers), 359-360     DAY 12   
wild (dangling/stray), 200, 218-220     DAY 8    
polymorphism, 8-9     DAY 1    
functions, 104-107     DAY 5    
see also inheritance
postfix operators, 62-64     DAY 4    
overloading, 282-284     DAY 10   
PostMaster e-mail-reading utility, 561     DAY 18   
data analysis, 563     DAY 18   
design issues, 572-573     DAY 18   
designing classes, 564-566     DAY 18   
PostMasterMessage class, 570-572     DAY 18   
designing interfaces, 567-569     DAY 18   
driver programs, 574-580     DAY 18   
platform specifications, 561-562     DAY 18   
project subdivision, 562-563     DAY 18   
pound symbol (#), preprocessors, 20     DAY 2    
precedence of operators, 686   Appendix A 
mathematical, 64     DAY 4    
relational/logical, 77-78     DAY 4    
predefined macros, 538     DAY 17   
prefix operators, 62-64     DAY 4    
overloading, 276-278     DAY 10   
preliminary designs, 555-556     DAY 18   
preprocessor directives
#define, 48, 526-529, 532-535     DAY 3         DAY 17   
#else, 528-529     DAY 17   
#endif, 527     DAY 17   
#ifdef, 527-528     DAY 17   
#ifndef, 527-528     DAY 17   
#include, 20-21     DAY 2    
inclusion/exclusion guards, 529-532     DAY 17   
#undef, 530-532     DAY 17   
preprocessors, creating/viewing intermediate files, 52     DAY 3    
printf() statement versus cout streams, 510-512     DAY 16   
printing
interim values for debugging, 546-547     DAY 17   
to screen, 21-23     DAY 2    
private class members versus public class members, 129     DAY 6    
private inheritance, 464-468     DAY 15   
problem space, 556     DAY 18   
examining components, 556-557     DAY 18   
program text, coding styles, 662     DAY 21   
programming
coding styles, 660-666     DAY 21   
computer environment, 10-11     DAY 1    
development cycle, 12-13, 554     DAY 1    
creating condition objects, 558     DAY 18   
data analysis, 563     DAY 18   
design issues, 572-573     DAY 18   
designing classes, 557-558, 564-566, 570-572     DAY 18   
designing interfaces, 567-569     DAY 18   
driver programs, 574-580     DAY 18   
event loops for simulations, 558-560     DAY 18   
examining problem space components, 556-557     DAY 18   
platform specifications, 561-562     DAY 18   
preliminary designs, 555-556     DAY 18   
simulations, 555     DAY 18   
structured, versus object-oriented programming, 6-7     DAY 1    
programs, 5     DAY 1    
accessing portions of, coding styles, 664-665     DAY 21   
bulletproof, 617     DAY 20   
CAT.CPP, 146-147     DAY 6    
components, 20-21     DAY 2    
driver, testing with, 574-580     DAY 18   
FUNC.CPP, 28-29     DAY 2    
HELLO.CPP (Hello World), 13-15, 20-21     DAY 1         DAY 2    
HELP.CPP, 24     DAY 2    
history, 5     DAY 1    
planning, 9-10     DAY 1    
RECTANGLE.CPP, 149-151     DAY 6    
project subdivision, 562-563, 571-572     DAY 18   
promotion, 327     DAY 11   
protected access, 342-344     DAY 12   
prototypes, building during program development, 568-5     DAY 18   
prototyping, see declaring
public class members versus private class members, 129     DAY 6    
public inheritance
components, 338-342     DAY 12   
constructors/destructors, 344-350     DAY 12   
overriding base class member functions, 350-355     DAY 12   
protected access, 342-344     DAY 12   
publications, source material, 666-669     DAY 21   
pure virtual functions, 396-397     DAY 13   
implementing, 397-400     DAY 13   
put() member function, cout object,     DAY 16   
putback() member function, cin object, 503-504     DAY 16   
qsort() function, 652-654     DAY 21   
question mark (\?) escape character, 47     DAY 3    

R


raising exceptions, 619-623     DAY 20   
RAM (random access memory), 34     DAY 3    
read() function, 517     DAY 16   
reading
from files, 512-517     DAY 16   
program text, coding styles, 662     DAY 21   
RECTANGLE.CPP program, 149-151     DAY 6    
RECTANGLE.HPP header file, 148-149     DAY 6    
rectangles
areas, calculating, 41-42     DAY 3    
creating, 148-151     DAY 6    
recursive functions, 109-112     DAY 5    
redirection, 491     DAY 16   
reference (&) operator, 228     DAY 9    
references
addresses of, 229-232     DAY 9    
combining with pointers, 250-252     DAY 9    
creating, 228-229     DAY 9    
null, 234     DAY 9    
passing by
comparing with passing by value, 242-249     DAY 9    
function argument values, 234-238     DAY 9    
returning multiple function values, 241-242     DAY 9    
returning to objects
non-existent objects, 252-253     DAY 9    
on free store, 253-255     DAY 9    
to istream objects, 496     DAY 16   
to objects, 232-234     DAY 9    
to ostream objects, 504-506     DAY 16   
versus pointers, 249-250     DAY 9    
relational operators, 66-67     DAY 4    
order of precedence, 77-78     DAY 4    
restoring memory to free store, 209-211     DAY 8    
return statements, 28     DAY 2    
return values, functions, 100-101     DAY 5    
returning
multiple values, 239-242     DAY 9    
references
to non-existent objects, 252-253     DAY 9    
to objects on free store, 253-255     DAY 9    
temporary objects in overloaded operator functions
named, 278-279     DAY 10   
nameless, 279-280     DAY 10   
this pointer in overloaded operator functions, 281-282     DAY 10   
rooted inheritance hierarchies versus non-rooted inher     DAY 18   
RTTI (Run Time Type Identification), 375-376     DAY 13   
runtime (dynamic) binding, 359     DAY 12   
runtime errors
debugging, 638-639     DAY 20   
exceptions, see exceptions

S


scope, 93-94     DAY 5    
global, 94     DAY 5    
in for loops, 177     DAY 7    
local, 96     DAY 5    
screens, printing to, 21-23     DAY 2    
security versus private declarations, 132     DAY 6    
self-assigned operators, 62     DAY 4    
setf() member function, cout object, 508-510     DAY 16   
setw manipulator, 509     DAY 16   
shallow copies, 289     DAY 10   
short int (integer) variables, 37     DAY 3    
size, 35     DAY 3    
short variables versus long variables, 43-45     DAY 3    
signatures, functions, 350     DAY 12   
signed int variables, wrapping large values, 44-46     DAY 3    
signed variables, 36     DAY 3    
simulations, 555     DAY 18   
preliminary designs, 555-556     DAY 18   
single inheritance, disadvantages, 372-377     DAY 13   
single quote (\') escape character, 47     DAY 3    
singly linked lists, 328     DAY 11   
sizeof() function, 36, 518     DAY 3         DAY 16   
sizes of variable types, determining, 35-36     DAY 3    
slicing, 361-363     DAY 12   
solution space, 556     DAY 18   
sorting tables or arrays, 652-654     DAY 21   
source code, 5     DAY 1    
compiling, 11-12     DAY 1    
conditional for multiple platforms, 532     DAY 17   
program text, coding styles, 662     DAY 21   
writing, source materials, 667     DAY 21   
source material, publications, 666-669     DAY 21   
spaghetti code, 159     DAY 7    
spelling names, coding styles, 663-664     DAY 21   
stacks
call, 624     DAY 20   
optimizing memory usage, 312-314     DAY 11   
standard libraries, 644     DAY 21   
state flags
ofstream objects, 513     DAY 16   
ostream, 506     DAY 16   
setting, 508-510     DAY 16   
statements, 28, 56     DAY 2         DAY 4    
blocks (compound statements), 57     DAY 4    
break, 163-165     DAY 7    
catch, 624-627     DAY 20   
continue, 163-165     DAY 7    
defining multiple variables in single statements, 40     DAY 3    
do...while, 168-170     DAY 7    
for, 170-177     DAY 7    
goto, 158-160     DAY 7    
if, 67-76     DAY 4    
in functions, 97     DAY 5    
initialization/test/increment, 171     DAY 7    
multiple in for loops, 172-173     DAY 7    
null, 56     DAY 4    
in for loops, 173-174     DAY 7    
printf(), 510-512     DAY 16   
return, 28     DAY 2    
switch, 180-186, 661     DAY 7         DAY 21   
typedef, with pointers to functions, 425-426     DAY 14   
while, 160-167     DAY 7    
whitespace, 56-57     DAY 4    
static
binding (compile-time), 359     DAY 12   
member functions, 413-415     DAY 14   
member variables, 408-413     DAY 14   
template members, declaring, 608-611     DAY 19   
stdlib library, 651-654     DAY 21   
stomping on pointers, 219     DAY 8    
storing data
free store, 207-217     DAY 8    
unknown quantities
in arrays, 312     DAY 11   
in linked lists, 327-333     DAY 11   
stray pointers, 218-220     DAY 8    
strcat() function, 648-649     DAY 21   
strcpy() function, 319-321, 645-648     DAY 11        DAY 21   
streambuf class, 490     DAY 16   
streams
buffers, 487-490     DAY 16   
encapsulation, 486-487     DAY 16   
see also I/O
String classes, 321-327     DAY 11   
string library, 644-649     DAY 21   
STRING.HPP file, 453     DAY 15   
stringizing (#) operator, 537     DAY 17   
strings, 317-319     DAY 11   
concatenating, 537-538, 648-649     DAY 17        DAY 21   
copying into other strings, 319-321, 645-648     DAY 11        DAY 21   
extracting from input, 499-501     DAY 16   
filling with cin, 493-495     DAY 16   
lengths, determining, 644-645     DAY 21   
parsing, 504     DAY 16   
substitutions, 537     DAY 17   
defining, 526-529     DAY 17   
writing to output, 505-506     DAY 16   
strlen() function, 644-645     DAY 21   
strncat() function, 648-649     DAY 21   
strncpy() function, 320-321, 646-648     DAY 11        DAY 21   
Stroustrup, Bjarne, 9     DAY 1    
structured programming versus object-oriented programm
structures, declaring, 151-152     DAY 6    
subscript operator, 308, 314     DAY 11   
subscripts, arrays, 300     DAY 11   
substituting strings, 526-529, 537     DAY 17   
subtracting
decrementing, 62-64     DAY 4    
large numbers from small numbers, 59-60     DAY 4    
subtraction operators
- (subtraction), 59     DAY 4    
-= (self-assigned), 62     DAY 4    
swap() function, 99-100     DAY 5    
with pointers, 236-237     DAY 9    
with references, 237-238     DAY 9    
switch statements, 180-186     DAY 7    
coding styles, 661     DAY 21   
symbolic constants, 48-49     DAY 3    
syntactic bugs, 616     DAY 20   
syntax
abstract data types, 397     DAY 13   
arrays, 307-308     DAY 11   
break statement, 165     DAY 7    
catch blocks, 623     DAY 20   
class statement, 133-134     DAY 6    
classes for virtual inheritance, 391     DAY 13   
continue statement, 165     DAY 7    
do...while statement, 169     DAY 7    
for statement, 171-172     DAY 7    
friend classes, 475     DAY 15   
friend functions, 478     DAY 15   
functions, 90-91     DAY 5    
goto statement, 159     DAY 7    
if statement, 71-72     DAY 4    
multiple inheritance, 380     DAY 13   
overloaded
binary operators, 287     DAY 10   
unary operators, 283-284     DAY 10   
pointers, 206     DAY 8    
to functions, 418     DAY 14   
static member functions, 415     DAY 14   
switch statement, 182-183     DAY 7    
try blocks, 623     DAY 20   
while statement, 161     DAY 7    

T


tab (\t) escape character, 47     DAY 3    
tables
sorting, 652-654     DAY 21   
v-tables (virtual function tables), 359-360     DAY 12   
tabs, coding styles, 660     DAY 21   
tail node, 328     DAY 11   
technical support, 666     DAY 21   
templates, 586     DAY 19   
declaring static members, 608-611     DAY 19   
exceptions with, 634-637     DAY 20   
explicit implementations, 602-608     DAY 19   
for array classes
declaring, 587-589     DAY 19   
implementing, 589-592     DAY 19   
names, 589     DAY 19   
friend types, 593-599     DAY 19   
functions, 592-593     DAY 19   
objects, passing to and from functions, 599-602     DAY 19   
parameterized array classes, 586-587     DAY 19   
versus macros, 535     DAY 17   
temporary objects, returning in overloaded operator fu
named, 278-279     DAY 10   
nameless, 279-280     DAY 10   
ternary operators, ?: (conditional), 79-80     DAY 4    
test statements, 171     DAY 7    
testing
with driver programs, 574-580     DAY 18   
with string substitution, 527-528     DAY 17   
text
editors, requirements, 10-11     DAY 1    
files versus binary files, 517-519     DAY 16   
strings, see strings
programs, coding styles, 662     DAY 21   
this pointer, 216-217     DAY 8    
returning in overloaded operator functions, 281-282     DAY 10   
to const objects, 222-223     DAY 8    
time library, 650-651     DAY 21   
time() function, 650-651     DAY 21   
__TIME__ macro, 538     DAY 17   
trailing zeros, 508     DAY 16   
trees, 328     DAY 11   
true values, nonzero, 66     DAY 4    
in if statements, 78-79     DAY 4    
try blocks, 619     DAY 20   
locations, determining, 624     DAY 20   
syntax, 623     DAY 20   
typedef (type definition) keyword, 42-43     DAY 3    
statements with pointers to functions, 425-426     DAY 14   

U


unary operators, overloading, 283-284     DAY 10   
#undef preprocessor directive, 530-532     DAY 17   
undefined symbol linker error, 410     DAY 14   
uninitialized character arrays, 318     DAY 11   
unsigned int variables, 37     DAY 3    
wrapping large values, 43-44     DAY 3    
unsigned long int variables, 37     DAY 3    
unsigned short int variables, 37     DAY 3    
unsigned variables, 36     DAY 3    

V


v-tables (virtual function tables), 359-360     DAY 12   
variables, 34     DAY 3    
adding values to and assigning results back to variabl
addresses, obtaining, 198-200     DAY 8    
aliases, 42-43     DAY 3    
char (character), 45-47     DAY 3    
counting, conventions, 177     DAY 7    
defining, 38-40     DAY 3    
multiple in single statements, 40     DAY 3    
global, 94-95     DAY 5    
initializing, 41-42     DAY 3    
local, 92-94     DAY 5    
arguments passed by value, 98-100     DAY 5    
defining within blocks, 96-97     DAY 5    
member, see member variables
memory divisions, 35     DAY 3    
overflow, subtracting large numbers from small numbers
short versus long, 43-45     DAY 3    
signed/unsigned, 36     DAY 3    
types, 36-37     DAY 3    
creating, 124-125     DAY 6    
sizes, determining, 35-36     DAY 3    
values
assigning, 40-42     DAY 3    
manipulating with pointers, 203-204     DAY 8    
retrieving with pointers, 201-202     DAY 8    
versus pointers versus addresses, 202-203     DAY 8    
virtual
copy constructors, 363-366     DAY 12   
destructors, 363     DAY 12   
functions
in exceptions, 632-634     DAY 20   
pure, 396-400     DAY 13   
inheritance, 388-391     DAY 13   
member functions, 355-367     DAY 12   
void function returns, 27-28     DAY 2    
vptrs (v-pointers/virtual table pointers), 359-360     DAY 12   

W


watch points, 639     DAY 20   
while loops, 160-161     DAY 7    
break/continue statements, 163-165     DAY 7    
do...while, 168-170     DAY 7    
endless, 165-167     DAY 7    
with logical operators, 161-162     DAY 7    
whitespace
filling strings with cin, 493-495     DAY 16   
in statements, 56-57     DAY 4    
width() member function, cout object, 506-507     DAY 16   
wild pointers, 200, 218-220     DAY 8    
Windows source materials, 668     DAY 21   
word processors, requirements, 10-11     DAY 1    
wrapping large values
in signed int variables, 44-46     DAY 3    
in unsigned int variables, 43-44     DAY 3    
write() member function, cout object, 505-506     DAY 16   
writing
Array classes, 334     DAY 11   
past ends of arrays, 302-304     DAY 11   
fence post errors, 305     DAY 11   
routines, versus buying libraries, 568     DAY 18   
single characters to output, 504-505     DAY 16   
source code, source materials, 667     DAY 21   
strings to output, 505-506     DAY 16   
to files, 512-517     DAY 16   

X-Z


zero (0), false value, 66     DAY 4    
in if statements, 78-79     DAY 4    
zeros, trailing, 508     DAY 16