< Previous | Contents | Next >
P
pAPointer pointer, 226
versus arguments, 184 assigning default arguments,
functions, 158–160
parentheses
constant pointer, 237–238 Swap Pointer Version program,
passing references
to alter arguments, 191–194 passing by reference, 194 passing by value, 193–194 Swap program, 191–193
constant references, 197–198 Inventory Displayer program,
PassTime() member function,
Critter class, 278 Peek() global function, 295 planning programs, 139–141
pseudocode, 139–140
Play Again 2.0 program, 56–57 Play Again program, 54–55
Play() member function,
Critter class, 280
Player class
BlackJack game, 357, 359,
arrays and, 244–248 Array Passer program,
constant pointer, 246–247 passing and returning,
assigning addresses to, 227–228
declaring, 226–227 declaring data member, 307 defined, 248
constant pointer, 237–238 Swap Pointer Version
returning, 238–244
Tic-Tac-Toe 2.0 game, 248 using with objects, 230–231
Pointing program, 224–226 Polymorphic Bad Guy program,
abstract classes, 352–356 Abstract Creature program,
declaring pure virtual functions, 354–355
deriving classes from, 355–356
main() function, 376–377 overloading the operator()
Player class, 368–369 defining virtual destructors,
Polymorphic Bad Guy program, 347–350
using base class pointers to derived class objects, 350–351
pop_back() member function
adding or removing elements, 138
postfix increment operator, 27–28 precedence level, operators, 15 predicate function, 113
prefix increment operator, 27–28 premature optimization, 186
priority_queue STL container, 139
Private Critter program, 264–266
private keyword, 267
private members, 282 class access levels, 267 defined, 340
protected members, 340, 379 prototypes, function
parameter names and, 159 pScore pointer, 224 pseudocode
Critter Caretaker game, 276 defined, 146
Tic-Tac-Toe game, 204 when to use, 148
ptrToElement() function, 241–242
public members, 282 class access levels, 266 defined, 339
push_back() member function, 292
adding or removing elements, 138