sample program, 350, 352
subtracting, 355
typeless, 351
use of, instead of indices, 359
Pointers to pointers, 682, 683
Pointer types, 231
Pointer variables, 231, 235, 683
addressing with, 353
and arrays, 351
Polymorphic interfaces, 571
Polymorphic objects
persistence of, 648, 650
storing, 649
Polymorphism, 3, 543-564
concept of, 544, 545
destroying dynamically allocated objects, 548, 549
dynamic casts, 552, 553
virtual methods, 546, 547
virtual method table, 550, 551
pop_back() method
for deleting objects in container classes, 765
popFront() method, 465, 467
pop() method, 765
Positioning flags, 641
Positioning methods, 643
Positive numbers
converting to, 142
Postfix increment, 430
Postfix notation, 85
effects of, 84
Precedence
Protected declarations, 515
Protected members, 515
Prototype, 175, 177
public base classes
is relationship established by, 589
Public interface, of class, 247
Public members, 245, 247
access to, in base class, 503
Public methods, 51
Pure virtual methods, 566, 567
pushBack() method, 465, 467
push_back() method, 759
push_front() method, 759
push() method, 759
put() method, 75, 391
Q
qsort() function, 689, 696, 697
QuadMatrix template, 734, 735
Quadratic matrices
class template representing, 734, 735
Queues
as sequential containers, 751
Quick sort algorithm, 187, 689
Quotient
of Fibonacci number, 325
R
rand(), 45
INDEX
■
819
Read-only methods, 277
Read-only pointers, 360
for non-constant objects, 361
Read-only references, 223, 225
Records, 257
inserting and retrieving, 655
position of, in files, 643
reading, 381
reading/writing blocks, 390
Recursive data structures, 465
Recursive functions, 186, 187
Redefined methods
calling, 513
Redefinition, 509
References, 3, 729
to abstract classes, 570, 571
conversions in, to base classes, 535
defining, 222
as parameters, 224
and pointers, 231
read-only, 223, 225
returning, 285
as return value, 226, 227
sample program, 222
Reference type function
calling, 227
register keyword, 205
Registers
CPU, 205
Register variables, 205
INDEX
Row class
defining, 694, 695
RTTI. See Run Time Type Information
Runtime behavior
of container classes, 759
runtime_error, 621
Run time errors, 621
avoiding, 43, 267
exception classes derived from, 620, 621
Run Time Type Information, 552
R-values, 233
S
Safe class, 514, 515
SavAcc class
defining, 648, 649
scientific manipulator, 65
Scope, 199
Scope resolution operator, 209, 211, 249
Screen control macros, 123, 125
Scrolling string output, 334
search() method, 655
seekg() method, 641
seekp() method, 641
SelectionSort() function, 697
Semicolon, 9, 103
Sequences
and header files, 752
operations for, 752
representing, 753
signed char type, 19, 142
Signed integers
converting, 142
signed keyword, 19
Signed type
conversion of, to larger integral type, 143
Sign extension, 143
Sign operators, 85
Simple assignments, 87
Single characters
meaning of, 26
Single quotes
character constants within, 25
size() method
and length of container, 763
and maps/multimaps, 773
and number of objects in container, 771
sizeof operator, 21
sort() method
list container sorted by call to, 767
SortVec container class
merge() method of, 762
search() method of, 760
using, 756
Source code, 7
Source files, 7, 249
layout of, 11
name, 7
INDEX
■
Star character, 233
State flags, 645, 647
Statements, 9
Static arrays, 325
Static binding, 551
Static data members, 304, 305
accessing, 306
declaring, 305
definition and initialization, 305
and encapsulation, 307
Static data structures, 463
Static functions, 207
static keyword, 305
static_cast, 537
Static lifetime, 199, 203
Static member functions, 307
Static objects, 203
static storage class, 202, 203, 207
std standard namespace, 9, 209
Storage classes, 199
of functions, 206
Storage class specifiers, 198
strcat() function
and return pointers, 363
strcmp() function, 327
index version of, 368
strcpy() function, 327
pointer versions of, 358
and return pointers, 363
Stream access errors, 651
strstr() function sample program, 362, 363
struct keyword, 257
structs sample program, 256
822
■
INDEX
Style, 11
Sub-object lattice, 595
Subroutines, 5, 181
Subscript, 323
Subscript operators, 165, 427
and access via indices, 761
bits referenced by, 777
in Matrix class, 695
overloading, 426, 427
read and write access using, 485
Substrings
erasing, 160
replacing, 162
Subtraction, 355, 417
swap()
implementing as method, 282
swap() function, 235
Swapping, 455
switch statement, 111
else-if chains contrasted with, 111
structogram for, 110
Symbolic constants, 121
sync() method, 70
Syntax, 249
Testing characters, 129
Text
mode, 386
and nesting loops, 103
Text editor, 7
this pointer
sample class DayTime, 280
using, 281
Throwing exceptions, 614
throw statement, 611
using, 610
timediff() function, 207
time() function, 167
time_t type, 261
tm struct, 260
Tokens, 11
Tone
and nesting loops, 103
top() method, 761
toupper() macro, 129
Traditional procedural programming, 4, 5
Translation unit, 199
true keyword, 23
trunc open mode, 386
Truth table
for logical operators, 90
try block, 615
nested, 616, 617
syntax of, 612, 613
Two-dimensional arrays
#undef directive, 127
Underscores
and internal names, 31
Unicode, 17
Union, 258, 259
defined, 259
Unique keys, 769
usetf() method, 60, 61
unsigned char type, 19
unsigned keyword, 19
unsigned short, 19
Unsigned types, 143
Unsigned value, 45
Unwinding the stack, 615
Upcasting, 536, 537, 553
User Network Interface, 715
using declaration, 211
using directive, 211
using keyword, 9, 49, 210
Usual arithmetic type conversions, 141, 145
performing, 142
V
va_arg() macro
arguments of, 687
valarray class, 48
Variables
defining, 33
defining in if statements, 105
names of, 31
pointer, 683
wchar_t type, 17, 19
what() method, 621
824
■
INDEX
what() virtual method, 647
while statement
structogram for, 96
structogram for break within, 112
syntax for, 97
Whitespace characters, 11
Width
bit-fields, 715
width() method, 67, 491
Wordbyte union
defining/using, 258
Write access
open mode for, 638
write_at() method, 642
WriteError type exception, 651
write() method, 391, 392, 393
of classes DepAcc and SavAcc, 648, 649
Write operation, 381
Writing
blocks of records, 390
characters, 75
X
XOR operator, 707
Z
Zero extension, 143