Dangling pointers, 519, 524–525
Data, computer programs and, 7–8
Data abstractions, templates for, 941–950
Data types, 44–45, 60–74, 95–97, 119–120, 944
arithmetic operators and, 69–74
bool
, 66
Boolean, 66
C++11, 63–64
char
, 64–66
character, 64–65
compatibility of, 68–69
constants as, 60–62, 65, 95–97, 119–120
double
, 44, 60–64
enumerated, 119–120
expressions and, 69–74
float
, 63
floating-point notation, 61–63
int
, 44, 60–62, 63, 70–72
integer, 60–62
long
, 62–63
names for declaration, 44–45
numeric, 44, 60–64
Op
shorthand notation, 74
short
, 63
string
class and, 66–68
templates for, 944
variables as, 44–45, 60–74
Debugging, 29–31, 162–164, 281–287, 287–291
assert
macro for, 290–291
bugs, 29
code, 290
common errors, 287
cout
statement for, 289–290
error messages, 30–31
functions, 281–287, 287–291
localizing errors, 288–290
logic errors, 30–31
loops, 162–164
off-by-one error, 162
retesting changes, 164
run-time errors, 30
second opinions and, 287
syntax errors, 30
testing programs for, 29–31, 281–287
tracing variables, 162–163, 288
warning messages, 30
Decimal (.
) notation, 55–56, 61
Declaration, 21–23, 44–45, 48–49, 193, 195–196, 199–201, 275–281, 310–311, 380–386, 428–429, 455–456, 491–492
arrays, 380–386, 428–429
cin
(input) statements for, 21–23
comma (,
) for separation in, 44, 433
cout
(output) statements for, 21–23
C-string variables, 455–456
double
variable type, 44
functions, 193, 195–196, 199–201, 275–281
illegal ranges, 385–386
indexed variables, 381–386
initializing in, 48–49
int
variable type, 21, 44, 380–382
memory and, 384–385
multidimensional arrays, 428–429
postconditions, 275–281
preconditions, 275–281
programmer-defined functions, 193, 195–196, 199–200
semicolon (;
) for end of, 44
square brackets [ ]
used for, 380–381, 491
streams, 310–311
type names and, 44–45
variables, 21–23, 44–45, 48–49, 64, 380–384, 455–456, 491–492
vectors, 491–492
Declared size, 381
decltype
, 64
Decrement operators (––
), 87–91, 143–144, 969–971
Default arguments, 350–351
Default constructors, 475–476, 586–587, 663
delete
operator, 519–520, 526–529, 532–533
Deque, 978
Dereferencing (*
) operator, 512–513, 963, 966–967
Derived classes, 600–605, 836–838, 839–847, 856–858, 862–863, 915
assignment (=
) operators used for, 862–863
colon (:
) for separation of, 602–603
constructors used in, 847–850
copy constructors used in, 862–863
defining, 602–605
destructors used in, 863
exception specification in, 915
implementation of, 836–838
inheritance and, 600–605, 836–838, 839–847, 856–858, 862–863
redefining functions, 855–858
Descendants, 846
Destructors, 673–675, 863, 877–878
dynamic arrays, 673–675
inheritance and, 862–863
polymorphism and, 877–878
virtual, 877–878
Digital versatile discs (DVDs), 6
digit
_to
_int
function implementation, 637–638
Direction arrows (<> >>
), 21
Directives (#
), 25, 52–53
Diskettes (floppy disks), 6
Division operator (/), 70–72
do
-
while
loop statements, 87–91, 139–140, 154
break
statement for, 154
execution of, 87, 139–140
infinite, 87–91
syntax of, 87–88, 139–140
Dot (.
) operator, 315, 547, 552
double
, 44, 55–56, 60–64, 70
arithmetic operators and, 70
decimal (.
) notation for, 61
exponent (e) notation for, 61
floating-point notation of, 61–62
numeric data type, 44, 60–64
output values from, 55–56
scientific notation of, 61–62
variable type, 44
Double quotes (
” ”)
for string characters, 64–65
Double-precision numbers, 60–61
Doubly linked lists, 762–763, 976
Drivers, function testing using, 282–284
Dynamic arrays, 523–529, 532–534, 669–684, 742, 759–760
array variables and, 523–525
assignment operator (=
) and, 759–760
call-by-value parameters and, 676–677
classes and, 669–684
constructors for, 670–673
copy constructors for, 677–681
creating and using, 524–529
delete
operator, 526–529, 532–533
destructors for, 673–675
linked lists and, 742, 759–760
multidimensional, 532–534
new
operator, 526–529
pointer arithmetic and, 530–531
pointer variables and, 523–525, 529, 742, 759–760
size of, 670–673
square brackets [ ]
used for, 526–529, 528–529
stringvar
class, 670–673
variables, 523–525, 529, 742, 759–760