
A
- B - C - D - E - F - G - H - I - J - K - L - M - N - O - P - Q - R - S - T - U - V - W - X - Y - Z
Index
Symbols
#define preprocessor directive 856
#endif preprocessor directive 856, 863
#ifndef preprocessor directive 856, 863, 865
#include preprocessor directive 122, 130, 304, 343
" " vs. < > 164, 343
&
as "address of" operator 619
as marker for reference argument 350
.cc file extension 73
.cpp file extension 73
.h file extension 73
.hpp file extension 73
// as comment marker 73
<cstring> header file 411
<fstream> header file 346
<iomanip> header file 631
<string.h> header file 411
= vs. == 158
->
defined 461
described 710
Numerics
16 bit register names 48
16 bit register names on a 32 bit machine 50
64 bit register 41
A
access function 505
access specifier 317, 395
private 327, 328, 395, 500
encapsulation and 503
member variables 364
why member variables should be 340, 397
protected 586, 652
defined 565
disadvantages of 600
use of 596
public 317, 327, 395
global variables and 501
why member variables should not be 341
repeating in class declaration 604
scope and 328
algebraic equality vs. assignment statement 75
algorithm
defined 3
aliasing
defined 753
problem 816
defined 754
argument
const reference 445, 890
temporary and 477-483
const string& 480
default 927
defined 857
defined 233
non-const reference 445, 446
passing 234, 890, 908
reference 350, 351, 398, 444, 445, 474, 476, 506, 507
reasons for using 482
to C function 619
value 234, 286, 288, 350, 474, 506
array
defined 489
exceeding bounds of 495
initialization list 826
defined 754
name translated to address 495
used in homegrown string class 543
vs. pointer 491-500
arrow keys, as input 940
ASCII code 105
assembler 49
assembly language 49-63
add instruction 91
defined 13
increment instruction 172
mov instruction 91
op code 89
operation code 89
assignment 129
defined 74
operator
See operator =
statement 74, 76
statement vs. algebraic equality 75
See also class, base class, derived class, polymorphic object
B
backslash 108
backspace key, editing with 945
base 16 numbering system 42
base 8 numbering system 41
base class 563, 564, 660
constructor 634-641, 653
special 741
default constructor 636
destructor 679
initializer 636, 637, 639, 653
object 635
part of derived class object 586, 598, 635
defined 565
base class pointer 653, 665
deleting a derived class object through 679
pointing to a derived class object 643, 699
BASIC language 283
batch file 126
beta testing 906
big-endian
See under endian 81
binary number system 32-37
defined 13
bit 63
blank lines
ignored by compiler 73
in input file 776
skipping 776
block 132
defined 68
bool 399
See under variable
booting the computer 20
bootstrapping 125
defined 20
break statement 354, 355, 398
buffer 565
defined 543
byte 63
defined 16
C
C
standard library 411
string
defined 412
vs. std::string 427
string literal 103, 131, 406, 427
defined 68
related to char* 433
type of 446
C++
address of char data for standard string 884
as a "language kit" 299
case sensitivity
of identifiers and keywords 69
of input 390
derivation of name 172
facilities not provided by standard 917, 948
header file preprocessor symbol convention 865
keywords and symbols, reusing 297, 444
operator precedence in 992
philosophy of 858
standard library xlii, 68, 162
reasons for using 859
standard, official name of 232
string position numbering convention in 882
type system 107
cache 24, 27, 53
calendar
and one-based indexing 167
call
See function call
carriage return 985
case statement 922
catch block 456
cerr 354
defined 795
char* 466, 477
use of for variable length data 421
character
nondisplay 108
nonprinting 107
special for program text 109
child class
See derived class
chip
defined 18
cin
defined 111
class
as a user-defined type 302
base
See base class
creating vs. using 393
defined 297
derived
See derived class
designing for others 602
first example definition 305
how to create 303
implementation 297, 303, 318, 392
interface 297, 392
interface and implementation files 303
interface definition 303
internals 318
leaving out name inside declaration 322
member function 297, 318, 322, 330, 393, 397
member variable 298, 319, 323, 330, 393, 397
membership operator ::
See under operator
scope of member variables 327, 329
size of objects determined 321
static member variable 327
types supported like native types 448
vs. namespace 926
clreol function 948, 986
code duplication, reducing 820
comment
defined 73
comparing two streams 804
compilation
defined 5
compiler
checking types of variables 107
defined 5
function of 72
memory leak reporting 457
relation to linker 304
compiler-generated
assignment 313
copy constructor 474
destructor 739
functions 395
vs. native type facilities 311
member functions 394
compiling the compiler 72
concrete data type 309-315, 394, 466, 894
compiler-generated functions 375
defined 308
conio library 948
console
defined 948
mode program 222
window 951
const 551
assignment not allowed to 324
defining a const value 541, 542
use with reference arguments 444
constructor 319, 322, 395, 466
defined 308
normal 333
See also class, base class, derived class, polymorphic object
continuation expression
See under for loop
controlled block
See under for loop
controlled statement
See under for loop
conversion function 875
Coplien, James 694, 696
copy constructor 310, 394, 395, 467
argument to 485
compiler generated 483
compiler-generated 475
defined 308
See also class, base class, derived class, polymorphic object
cout
defined 110
existing types and 535
user-defined types and 533
CPU 22
defined 13
crashes, cause 454
creating data types
See class
curly braces 101, 116
See also block
See also for loop
cursor
defined 911
D
dangling pointer 661
data file
creating programmatically 797
data input
preventing improper 203
debugging
defined 9
decimal system
defined 12
default
defined 255
default constructor 310, 319, 320, 331, 394, 466
compiler-generated 332
defined 308
private 332
See also class, base class, derived class, polymorphic object
default keyword 838
defensive programming 737
delete
See under operator
derived class 564, 586, 660
constructor 636
location of definition 604
object 635
See also class, base class, polymorphic object
derived class object 651
destructor 310, 394, 466, 678
compiler-generated 594
defined 308
implementation for homegrown string class 463-465
normally called automatically 464
order of execution 735
unique for a given class 739
virtual 679, 738, 750
why we need a 680
why we need in a base class 679
See also class, base class, derived class, polymorphic object
device independence 964
digit
definition of 12
double
See under variable
double quotes 106
dump
defined 810
dust bunnies 14
Dvorak keyboard 170
dynamic memory allocation 417
error prone nature of 456
dynamic typing
defined 658
E
EBCDIC character code 106
echoing data to the screen 943
else statement 114
empty C string literal "" 325
encapsulation 341, 503
defined 298
end pointer
See under stream
endian
big 81
little 81
endl 114, 623
endless loop 914, 983
end-of-file condition
handling properly 795
ENIAC 69
enum 824, 852, 915
automatic conversion to integer type 828
defined 754
why we should not do arithmetic on 831
escape sequence 142
exception 455
executable program 249, 250
defined 5, 74
executing code before the beginning of main 744
Exiguus, Dionysius 167
exit
code 126
statement 456
explicit keyword 875, 878
extended string class
See xstring
external cache 25, 51, 64
Extreme Programming 855
F
fail
See under stream 398
fencepost error 357
field 631
fixed-length data 103
float
See under variable
floating-point flaw, Pentium 69
floppy disk 15
for loop 170-177, 208
continuation expression 171, 208
controlled block 171, 174
controlled statement 174
inner loop 186
iteration 175
modification expression 171, 208
outer loop 186
starting expression 171, 208
for statement
See for loop
formatting of the display 954
form-feed character 962
FORTRAN 169
free store 434
friend 538, 539
vs. inheritance 584
See also class, base class, derived class, polymorphic object
function 221-293
argument list 231, 233, 287
call 222, 225, 287
virtual 662
call by value 234
called 222, 233, 238, 287
calling 222, 225, 231, 233, 260, 287
declaration 230, 287
defined 222
example of use 229
global
disadvantages of 859
machine language call instruction 261, 266
machine language return instruction 266
main 226, 229
nested 244, 258
retrieval 223
return 245
return 0 228
return address 260, 288
return statement 222, 227, 288
return type 230, 231, 287
incompatible 231
int 228
return value 378
returning more than one value 931
side effects 227, 340
signature 333, 658
storage 223
undefined 243
virtual 661
calling most recently defined version of 851
calling through a base class pointer 665
defined 658
English description of mechanism 673
operation of 666-676
polymorphism and 666
protected 817
reusing code via 783
valid object required to call 717
vtable and 675
vs. module 223
why user-defined only 428
function overloading 333, 337, 395
using to select a special constructor 721
G
garbage in, garbage out 203
general register 52, 78
getdate function 619
getline
See under stream
global namespace
See under namespace
gotoxy function 948, 986
grocery inventory program 295-404, 563-752
H
halting problem 906
hard disk 15
access time 17
head crash 15
platters 15
recording heads 15
rotational delay 19
sectors 16
seek 19
tracks 16
hardware
defined 5
header file 73
Heller, Steve
contact information xlv
hexadecimal
digit 42
hexit 42
notation 41
number system
defined 12
numbers 65
home inventory program 753-989
analyzing the final version 913-983
homegrown string class 405-561
(char*) constructor 435
calling 436
implementation of 436
C string literals vs. 406
comparison operators 553
constructor 424, 425
containing a null byte 518
copy constructor 508
creating 405-561
defined 408
destructor 465, 471
null byte at end 520
operators
!= 557
< 533
<= 557
== 531
> 556
>= 556
reading from an istream 540
HomeInventory class
See home inventory program
HomeItem class
See home inventory program
HomeUtility namespace 930-955
I
I/O
defined 110
identifier 68, 232
defined 67
global 273
ideographic languages 97
idiom, programming 695
if statement 113, 116
conditions 158
ifstream 346, 353, 397, 576
See also stream
ignore function
See under stream 546
implementation file 73, 220
defined 222
implementation module 221
implicit conversion 875
include guard 856, 863, 864, 907
incremental development 897-905
incrementing a variable 172
indexing
one-based 166, 167-168
zero-based 166, 167
inexpensive
defined 254
information hiding 763, 823
inheritance 563-566, 583-615, 634-651
for extension 614
virtual functions and 658
See also class, base class, polymorphic object
initialization vs. assignment 542
instruction fetch 23
int
See under variable
int main() 100
integer
how negative values are stored 37
integral type 100
Intel architecture 58
internal cache 52, 64
internal polymorphism
See polymorphic object
internals
defined 298
Inventory class
See under grocery inventory program
iostream 220, 353
manipulators 632, 633
using with class types 339
See also stream
isA 613
defined 566
istream 214, 575
reading from 547
See also stream
K
keyword 67, 233
defined 68
L
least recently used (LRU) 28
library
See library module
library module 219, 249, 252
defined 222
link time 269, 276
linker 249, 288, 304
linking
defined 249
literal value 237
defined 74
vs. named constant 542
little-endian
See under endian
logical AND operator &&
See under operator
logical OR operator ||
See under operator
long
See under variable
loop
defined 115
loop control
See while loop, for loop
lpt1 921
LRU 28
M
machine instruction 49, 57
defined 13
machine language program
defined 72
magic numbers 971
main function 101
manager/worker idiom 748, 758
defined 694
See also polymorphic object
manipulator
See under stream
megabyte
defined 16
megahertz
defined 23
member function
See under class
member initialization
expression 323
list 323, 636
member variable
See under class
memberwise copy 475, 506
memcmp 529, 549
memcpy 419, 422
memory
address 19, 21
allocation errors 453
leak 455, 679
memory hierarchy 24, 51
memory manipulation functions
hazards of 548
memory protection facilities 251
memory-to-memory instructions 52
memset 544
MIPS
defined 69
modification expression
See under for loop
module 221, 223
modules
affected by a change in a header 249
MS-DOS 251
multicharacter constant 138
multiplication symbol "*" 34
N
named constants
naming convention 542
namespace
creating our own 925, 926
defined 99
global 911, 926
scope and 285
namespace permissions
blanket 335
nanoseconds 20
new
need for 418
source of memory for 434
newline 936, 986
used as string terminator 545
non-const array size not allowed 544
nonmember function 395, 502
non-standard library 948
normal constructor
defined 565, 726
Notepad 73
null byte 104, 131
use in C string 428
null object 377, 400
O
object 299, 302, 392
defined 297
See also class, base class, derived class, polymorphic object
object code 222
defined 5
library 220
module 219, 248
defined 222
object file 248, 288
defined 222
object member access operator
defined 308
object-oriented design 589, 878
object-oriented programming 302, 393
.primary organizing principles 341
defined 298
octal 41
off by one error 357
ofstream 576
See also stream
operating system facilities 250
operator
514, 519, 533, 534, 535, 536, 540, 549, 549, 550, 685
&& 524
++ 172, 960
+= 217, 363
. (period) 451, 458
/ 110
::
as class membership operator 309, 322
as scope resolution operator 273
-= 363
= 74, 310, 394, 438, 440, 466
and copy constructor 507
as assignment operator 75
compiler-generated 312, 594
declaring for homegrown string class 447
defined 308
description of 459
for native types 312, 313
hypothetical version with explicit this 462
implementation for homegrown string class 438-462
reference argument to 506
return value from 443
user-defined 312
user-defined for homegrown string class 441
why it needs a reference argument 474, 475
== 158, 550
>> 215, 348, 550
polymorphism and 691-692
|| 389
class membership :: 309
delete 452
destructor and 737
for class type 679
improper call to 453
pointers and 691
new 417
for object of class type 643
reporting failure 455
use of 420
redefining 443
scope resolution :: 273
ostream 214, 575
See also stream
override
defined 564
overriding a base class function 589, 651
P
parent class
See base class
parentheses 175
in conditional expression 116
partial assignment
See slicing
peek function
See under stream
plural terms, not used in C++ xlv
pointer
array address and 491
declared type used for type checking 743
defined 414
different meanings of 415
hazards of 548
invalid 454
member access operator -> 461
near-equivalence to array 496
new and 420
not a concrete data type 595
problems with copying 440
to same type being defined 699
types of 432
used for variable-length items 429
using only inside class implementations 452
variable types relevant to 415
why it is dangerous 661
polluting the global namespace 927
polymorphic object 694-744, 748, 758-823
avoiding an infinite regress during construction 720
base class constructor 719
base class destructor and 739
base class initializer 719
class registry function 745
copy constructor 728
default constructor 717
defined 694
destruction of 740
destructor 735
key to implementation of 710
operator = 730, 733
preventing infinite regress in 750
reference counting
assignment and 733
similarities between different types of 759
slicing avoided by using 732
special constructor 720, 721
polymorphism
adding types at link time 745
and pointers 676
dangerous 659-693
defined 658
native mechanism 661
safe
See polymorphic object
positional number systems 44
prefetch queue 61
prefetching 61, 62
premature destruction 475
preprocessor 863, 907
defined 856
preprocessor directive 121, 863
defined 856
preprocessor symbol 863
defined 856
private
in class declaration line 614
inheritance 613
See also under access specifier
processor 63
program counter 261, 262
program failure 200-201
program maintenance 583
programming
as creating a virtual computer 247
by stepwise refinement 7
defined 4
waterfall mode of development 4
programming defensively 796
protected member function 617
protected vs. private variables 599
public
in class declaration line 612
inheritance 613
See also under access specifier
pumpkin-weighing program 118-128, 150-209
Purify, by Rational Software 454
put pointer
See under stream
Q
QBASIC 283
quotes
use of single and double 104
QWERTY keyboard 170
R
Radio Shack TRS-80 Model III 283
RAM 23, 63, 77, 197
defined 18
reallocating memory 792
recursion 258, 642
reference counting 694, 723-744, 750, 816
defined 658
delete and 723
references to pointers 689
register 28, 53, 64
16-bit 30
32 bit 30
dedicated 28
general 29
regression testing 808
regular member function 592
defined 564
See also class, base class, derived class, polymorphic object
resize function 791
retrieval function 340
return statement
See under function
ROM
defined 20
runaway program 251
run-time efficiency 166, 167, 202
S
scope
class 396
defined 267
defining a namespace 285
global 267, 289
local 267, 289
variable going out of 464
vs. access specifier 328
scope resolution operator::
See under operator
screen, number of lines 951
scroll area 953, 954
searching
case sensitivity in 880
case-insensitive 880
selection expression 838
selection sort 178, 189, 207, 208
separate compilation 684
setfill manipulator 631, 633
setw manipulator 631, 633
short
See under variable
short-circuit evaluation rule 390
size function 785
different for each type of Vec 786
slicing 615, 860
software
as a virtual computer 247
defined 5
software development process 906
sorting
case sensitivity and 512
source code
defined 5
source file 73
space after numeric value 937
space character 104
spaces
allowed between components of a name 322
square brackets 163
in assembly language program 79, 84
stack 258-267
empty 259
layout of data in 262
memory usage of 260
overflow 289
pointer 261, 262
16 bit 261
32 bit 261
pop a value 259
push 259
retrieve a value 259
return addresses stored on 261
usage of 265
use of 288
using for temporary storage 285
stack-based addressing 264
standard library
identifiers 335
string class
undesirable behavior when initialized with 0 878
why we should use 348
standard member functions
implementing for polymorphic object 715
See also class, base class, derived class, polymorphic object
standard string class
case sensitivity of 857
See also string class, homegrown string class, xstring classt
starting expression
See under for loop
startup library 252
statement
defined 72
static array 826, 852
static member function 615-617, 799
defined 565
static protected member function 617
static type checking 744
static typing
defined 658
vs. static keyword 658
std
namespace 99
using in header files 335
StockItem class
See under grocery inventory program
storage class 297
auto 257
dynamic 417
static 269, 288
storage function 340
stream 214, 627
buffer 622
buffering 942
clear function 938
end pointer 625, 629
fail 355
flush function 941, 962
get pointer 625
getline
specifying terminating character 547
ignore function 933
manipulator 631
defined 564
maximum number of characters 934
peek function 546, 936
put pointer 622, 629
resetting status 935
stream classes 621-634
string class
adding case insensitivity to 858
peculiarities of standard library version 348
why it isn't a native type 407
See also standard string class, homegrown string class, xstring class
stringstream 620, 627, 629, 634, 652
defined 624
strlen 428
strnicmp 884, 908
Stroustrup, Bjarne 12, 39, 257
on the type system 348
subscript
See index 164
substring, searching by 888
switch statement 837, 921
defined 754
selection expression 754
T
temporary 482
temporary variable 478, 508
text editors 73
this 460, 461
defined 450
throwing an exception 455
tilde
as marker for destructor 465
token 449
touch typing 170
transistors 18
try
block 456
defined 456
Turbo Pascal compiler 248
Turing machine 247
Turing, Alan 247, 906
twinned strings 507
type
implicit conversion 231
type checking
dynamic 107
static 107, 231
U
underscore character _ 233
Unicode standard 97
uninitialized
const 542
variable
See under variable
unqualified name 451
user-defined
assignment 313
data type 295-989
user-defined data type
See also class
user-defined name
See identifier
using names from a namespace 99
using namespace std 98, 99
V
variable
allocation
automatic vs. static 268
assigning a memory address 253
assigning storage at link time 253
auto 254, 255, 257, 258, 268, 288
automatic initialization not supplied for auto type 254
bool 295, 363
char 96
as a very short numeric value 494
deallocating 463
defined 29
double 295, 763, 992
float 295, 992
floating-point 30, 169, 819, 992
fully supported 296
global 267, 269, 274, 279
disadvantages 282
index 169
pre-standard scope of 779
scope of 779
initial value 253
initializing 202, 268, 276
static 253
int 100
integer 29
local 267
defining when needed 778
long 295, 763
native type 295, 297, 310
nonnumeric 71, 96
numeric 30, 71, 129
range
double 1012
float 1015
int 1020
long 1022
short 39
scalar 164
scope 255, 267, 289, 326
short 30, 39, 64
signed 37
signed char 96
signed short 38, 39
static 253, 254, 255, 269, 279
static storage class 253
storage class 253, 288
auto 296
static 296
string 96, 97
types 280
uninitialized 192, 194-199, 241
unsigned 38
unsigned char 96
unsigned short 38, 39, 64
user-defined type 295
Vec 150, 162, 166, 207, 252, 785, 786, 850, 852
creating only when needed 778
element 208
index 163
index variable 208
mixing types of objects in 746
resizing 791
setting size 792
size function 952
sorting a Vec of strings 510
used with class types 344
vs. vector 194
vector 161, 252
element 161
See also class, scope, storage class
variable-length data 103
Vec See under variable
Vec.h 162
vector
See under variable
vector vs. Vec 194
vertical bars ||
See under operator ||
virtual computer 247
virtual function
See under function
void
as return type 340
void type 339, 397
vtable 662, 667, 674, 747
W
while loop 115
Windows 251
Windows 2000 251
Windows NT 251
Windows Write 73
Word for Windows 73
X
xstring class 857-887
concatenation 868
operator + 870
why we don't have to worry about slicing 867
Z
zero
accidental initialization by 873
initialization of a string by 878
not using indiscriminately 722
oddities of 781, 873
pointer
deleting is legal 453
zero-character C string literal 325
zero-character string 413
|
Quadralay Corporation http://www.webworks.com Voice: (512) 719-3399 Fax: (512) 719-3606 sales@webworks.com |