< Previous | Contents | Next >
A
abstract classes, 352–356, 380, 382
Abstract Creature program, 352–354
declaring pure virtual functions, 354–355
deriving classes from, 355–356 virtual functions and, 355
Abstract Creature program, 352–354
abstraction
Simple Boss 2.0 program, 338–339
using access modifiers when deriving classes, 340
using access modifiers with class members, 339–340
access modifiers
using when deriving classes, 340 using with class members,
access_global() function, 168 accessing
global variables, 168 member functions of array
member functions of vector element, 129–130
accessor member functions, 267– 268, 282
action statement, for loop, 82 Add() member function, 292 Add New Item dialog box,
addition (þ) operator, 14, 92
advanced classes
aggregation, 287–292 container data members,
friend functions creating, 295
Friend Critter program, 292–294
Lobby::AddPlayer() member function, 320–322
Lobby::Clear() member function, 322–323
Lobby::RemovePlayer()
operator<<() member function, 323–324
operator overloading, 295–296 again character, looping, 57–58 aggregation, 287–292
container data members, 291–292
AI (Artificial Intelligence), 203
399
400 Index
find(), 134
sort(), 135
allocating dynamic memory, 296–303
avoiding memory leaks, 301–303
altering
object through returning pointers, 243–244
object through returning references, 202
reference values, 190–191 value of variable, 26
American Standard Code for Information Interchange (ASCII), 22, 393–396
announceWinner()function, Tic-Tac-Toe game, 217
ANSI (ANSI/ISO) standard, 5 argument variable, 191, 197
versus parameters, 184 passing references to alter,
Expensive Calculator program, 13–14
floating point division, 14–15 integer division, 14–15
order of operations, 15 subtracting, 14
Array Passer program, 244–246 arrays, 96–106
accessing member functions of array element, 100
Hero's Inventory program, 96–98
indexing, 105–106 Tic-Tac-Toe Board
pointers and, 244–248 Array Passer program,
constant pointer, 246–247 passing and returning,
Artificial Intelligence (AI), 203
ASCII (American Standard Code for Information Interchange), 22, 393–396
askNumber() function
assigning default arguments to parameters, 173
Mad Lib game, 182 Tic-Tac-Toe game, 209
askText()function, Mad Lib game, 182
askYesNo1() function
Mad Lib game, 157–158 Tic-Tac-Toe game, 208–209
assembly language, 2 assigning values
to character variables, 21–22 to floating point variables, 21 to integer variables, 21
assignment operator (=), 21, 44,