Sams Teach Yourself C++ in 21 Days

(singke) #1
running, 18
source code, 17, 25-26
testing, 19-20
Hello.cpp file, 17, 26
hex flag, 618
hexadecimal numbers,
813-816
converting to decimals,
813
escape characters, 59
hiding
compared to overriding,
389
methods, 387-389
history of C++, 5-7, 11
.hp filename extension, 163
.hpp filename extension, 163
Hungarian notation, 49

I

I/O objects, 597-598.
See alsostreams
cerr, 598
cin, 598-600
extraction operator,
603-604
get( ) method, 604-608
getline( ) method,
608-610
ignore( ) method,
610-611
multiple input, 601-603
peek( ) method,
611-612
putback( ) method,
611-612
strings, 600-601
clog, 598
cout, 598
fill characters, 616-617
fill( ) method, 616-617
flags, 617-620
flush( ) method, 613
output width, 615-616
put( ) method, 613-614
setf( ) method, 617-620

width( ) method,
615-616
write( ) method,
614-615
identifiers
hiding, 639
naming, 781-782
If Horses Could Fly
(code listing), 450-451
if statements, 80-82
branching, 81-82
else keyword, 84-85
indentation styles, 83-84
nesting
braces ({ }), 88-89
example, 86-87
semicolon notation, 83
syntax, 85
#ifndef command, 754
ignore( ) method, 610-611
imitating RTTI (Run Time
Type Identification), 453
implementing
buffers, 597
classes, 165
containment, 552-553
methods, 151-154
const methods, 159
inline, 163-166, 326
pure virtual functions,
478-482
streams, 597
swap( ) function
pointers, 264-265
references, 265-267
include files, 784
include statement, 26, 38
inclusion guards, 755-756
increment functions,
303-304
increment operator (++),
74-76, 303-304
indenting code, 779
if statements, 83-84
switch statements, 780

indirection operator (*),
225-226, 280
inheritance, 10-11, 371-373
adding to two lists, 456
casting down, 453-455,
487
compared to templates,
712
constructors, 378-385
containment, 537
accessing members of,
545
compared to
delegation, 553-561
constructors,
546-549
costs, 546-549
Employee class,
542-544
filtering access to, 545
implementing, 552-553
passing by value,
549-552
String class, 538-542
derivation, 372-376, 404
destructors, 378-381
limitations, 449-452
mixins, 473
multiple, 456-459
ambiguity resolution,
463-464
class design, 358-359
constructors, 460-463
declaring, 459
example, 457-459
limitations, 472
objects, 460
shared base classes,
464-468
virtual methods, 459
private, 562-563
compared to
containment, 590
methods, 562
sample program
listing, 563-570
usage tips, 571

inheritance 897

How can we make this index more useful? Email us at [email protected]

34 0672327112 index.qxd 11/19/04 12:31 PM Page 897

Free download pdf