Sams Teach Yourself C++ in 21 Days

(singke) #1
declaring, 302-303
increment functions,
303-304
counting
numbers, 183-184
variables, 195
cout object, 28-30, 598
example, 28-29
fill characters, 616-617
flags, 617-620
methods
fill( ), 616-617
flush( ), 613
put( ), 613-614
setf( ), 617-620
width( ), 615-616
write( ), 614-615
output width, 615-616
passing values to, 29
.cp filename extension, 14
.cpp filename extension, 14,
162
CRC (class,
responsibility, and
collaboration) cards
anthropomorphic, 355-356
CRC sessions, 354-355
limitations of, 356-357
responsibilities, 355
transforming to UML, 357
customer roles (use cases),
337-339

D

%d conversion specifier, 620
dangling pointers, 245-248
data hiding, 10
data members
accessing, 143-146
classes, 166-171
free store
accessing, 239-241
pointers, 241-243

private, 144-145, 172,
376-377
protected, 376-377
public, 144-146
security, 148-149
static
accessing, 508-511
advantages, 533
defining, 507
example, 506-507
data slicing, 397-399
data types, 46
abstract, 473, 476-477
advantages, 488
declaring, 478
deriving from other
ADTs, 482-486
example, 477-478
pure virtual
functions, 477
bool, 79
converting, 320-324
creating, 139, 644
deallocating memory,
235-237
DEBUG mode, 769-771
debuggers, 746-747
debugging, 746-747.
See alsotroubleshooting
assemblers, 747
assert( ) macro, 762-764
breakpoints, 747
examining memory, 747
inclusion guards,
755-756
printing interim values,
769-771
watch points, 747
dec flag, 618
decimal numbers, 808
converting to base 6, 810
converting to base 7,
809-810
converting to binary,
810-814

declaring
abstract data types, 478
arrays, 408, 414-415
object arrays, 416-417
on free store, 426
two-dimensional, 420
classes, 163, 783
Cat, 141, 164-165
Counter, 302-303
derived classes,
374-376
errors, 159-162
friend classes, 580
Point, 166-167
Rectangle, 168-170,
296
Rectangle class,
210-216
String, 437-443
constants
#define statement, 60
const statement, 60
constant substitutions,
753
data types, 644
functions, 101-103,
143-144
Add( ), 313-314
const, 158
example, 104-105
file locations,
162-163
friends, 585
inline, 122-124,
771-772
namespace
functions, 645
macros, 756-757
method default values,
292-294
multiple inheritance, 459
namespaces, 643-644
objects, 142, 150
pointers, 224, 248-249,
231, 528

892 Counter class

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

Free download pdf