abs
function, 186–187
Absolute value functions, 186–187
Abstract data types (ADT), 590–599, 707–717
application file, 716
case study: DigitalTime
–a Class Compiled Separately, 708–714
class types for, 590–599
compiling programs using, 707–717
implementation files, 594–599, 710–717
information hiding, 599
interface files, 594–595, 707–709
private
member function changes, 595, 599, 707–718
programming, 590–599
reusable components of, 717
separate compilation using, 707–717
writing, rules for, 593–594
Accessor functions, 569–570, 628
Adapter container classes, 981–985
addition (+), 70
Addresses, 4–5, 32, 511–513, 530–531
address–of operator (&), 513
arithmetic performed on pointers, 530–531
memory location and, 4–5, 32
pointers, 511–513, 530–531
ADT, see Abstract data types (ADT)
Algorithms, 12–16, 30–32, 212–213, 278, 402–404, 794–795, 813–814, 928–940, 993–1006
abstraction, 928–940
array programs, 402–404
bubble sort, 423–425
design, 212–213, 278, 402–404, 794–795
development of, 12–14
generic, 993–1006
implementation phase, 15
logic errors, 30–31
object-oriented programming (OOP) for, 16–17
problem solutions using, 12–15
problem-solving phase, 15
procedural abstraction and, 212–213, 278
program design using, 15–16
programming use of, 12–16, 32
pseudocode, 213
recursion programs, 794–795, 813–814
templates for, 928–940, 993–1006
Ampersand symbol (&
), 260–261, 263, 268, 270–271, 513, 521
Ancestor class, 846
And operator (&&
), 78–79, 112–116
Appending to a file, 322–324
Application file, ADT, 716
Arguments, 183–184, 197–198, 200–201, 265–268, 334, 348–351, 391–400, 461–462, 550–551, 587–588, 749
array parameters for, 393–398
arrays and, 391–400, 461–462
C strings, 461–462
call-by-reference parameters, 265–268
call-by-value parameters, 197–198
character I/O, 348–351
const
parameter modifier for, 396–399
constructors without, 587–588
default, 350–351
formal parameters and, 197–198, 200–201
function calls using, 183–184, 197–198, 265–268
function subtasks using, 265–268
functions in arrays, 391–400
incorrect order of, 200–201
indexed variables as, 391–393
linked lists as, 749
parentheses ( )
and, 184
predefined functions, 183–184, 461–462
programmer-defined functions, 197–198, 200–201
streams as, 334, 348–349
structures as, 550–551
Arithmetic functions, 1039
Arithmetic operators, 69–74, 112–116, 530–531
addition (+), 70
assignment operator (=)
and, 69, 74
Boolean operations compared to, 112–115
data types and, 69–72
division (/), 70–72
double
used with, 70
expressions and, 69–72
int
used with, 70–72
multiplication (*
), 70
negative integers in, 71
Op
shorthand notation, 74
parentheses ( )
for order of, 71
pointer addresses using, 530–531
remainder (%
), division with, 70–71
subtraction (-
), 70
variables and, 69–72
Array parameter, 393–398
Array variables, 523–525
Arrays, 379–452, 455–474, 523–529, 532–534, 662–684, 1047–1048
arguments to functions, 391–400
base type, 381
C strings, 455–474
case study: Production Graph, 400–411
class members, 666–669
classes and, 662–684, 944–945
const
modifier, 396–399
constructor calls for, 663
declaring, 380–386, 428–429, 455–456
dynamic, 523–529, 532–534, 669–684
errors in, 385–386
for
loops used with, 382
functions and, 391–400
index (subscript), 381, 385–386, 1047–1048
indexed variables and, 381–388, 391–393, 428, 433
initializing, 388, 456–457
int
data types, 380–384
memory locations, 384–385, 395–396
multidimensional, 427–433, 532–534
overloading, 1047–1048
parameters, 393–399, 416, 428–429
partially filled, 413–415
programming with, 413–425
referencing, 380–386
searching, 416–418
size of, 381–384, 396, 413–416, 428–429
sorting, 419–425
square brackets [ ]
used for, 380–381, 394–395, 429
std::array
, 1007–1008
strings as types of, 455–474
subtasks for functions of, 401–402
two–dimensional, 429, 533–534
variables in, 380–388, 391–393, 455–462
Arrow (->
) operator, 744, 746
Ask-before-iterating looping technique, 157, 159
Assembly language, 8
assert
macro, 290–291
Assignment operator (=)
, 69, 74, 81–82, 495, 513–514, 516, 571–572, 682–684, 759–760, 862–863
Assignment statements, 46–49, 513–514
pointers and, 513–514
variable values and, 46–49
Associative containers, 985–992
Asterisk symbol (*
), 22, 70, 511–514
atof
function, 469
atoi
function, 469–470
atoll
function, 469
Augusta, Ada, 12–13
auto
C++11, 63
using with containers, 992
variable declaration using, 966
Automatic variables, 520