< Previous | Contents | Next >

A

abstract classes, 352356, 380, 382

Abstract Creature program, 352354

declaring pure virtual functions, 354355

deriving classes from, 355356 virtual functions and, 355

Abstract Creature program, 352354

abstraction

encapsulation and, 160

functions, 155

access control, 337340

Simple Boss 2.0 program, 338339

using access modifiers when deriving classes, 340

using access modifiers with class members, 339340

access modifiers

using when deriving classes, 340 using with class members,

339340

access_global() function, 168 accessing

array elements, 246

data members, 259260

global variables, 168 member functions of array

element, 100

member functions of vector element, 129130

reference values, 190

static data members, 272273

accessor member functions, 267268, 282

action statement, for loop, 82 Add() member function, 292 Add New Item dialog box,

386fig

addition (þ) operator, 14, 92

address, variable, 249

advanced classes

aggregation, 287292 container data members,

291292

Critter Farm program, 288290

object data members, 290291

friend functions creating, 295

Friend Critter program, 292294

Game Lobby program, 315325

Lobby class, 318320

Lobby::AddPlayer() member function, 320322

Lobby::Clear() member function, 322323

Lobby::RemovePlayer()

member function, 322

main() function, 324325

operator<<() member function, 323324

Player class, 316318

operator overloading, 295296 again character, looping, 5758 aggregation, 287292

container data members, 291292

Critter Farm program, 288290

defined, 325

object data members, 290291

AI (Artificial Intelligence), 203

399

400 Index


algorithms, 131135, 146

defined, 116

find(), 134

High Scores program, 131133

preparing to use, 133

random_shuffle(), 134135

sort(), 135

allocating dynamic memory, 296303

avoiding memory leaks, 301303

delete operator, 300301

Heap program, 297299

new operator, 299300

altering

global variables, 169

iterators, 128

object through returning pointers, 243244

object through returning references, 202

reference values, 190191 value of variable, 26

American Standard Code for Information Interchange (ASCII), 22, 393396

AND (&&) operator, 61tbl, 77

announceWinner()function, Tic-Tac-Toe game, 217

ANSI (ANSI/ISO) standard, 5 argument variable, 191, 197

arguments, 70

versus parameters, 184 passing references to alter,

191194

arithmetic operators, 1315

adding, 14

Expensive Calculator program, 1314

floating point division, 1415 integer division, 1415

modulus operator, 15

multiplying, 14

order of operations, 15 subtracting, 14

Array Passer program, 244246 arrays, 96106

accessing member functions of array element, 100

bounds checking, 100101

creating, 9899

Hero's Inventory program, 9698

indexing, 99100

multidimensional, 103106

creating, 105

indexing, 105106 Tic-Tac-Toe Board

program, 103105

pointers and, 244248 Array Passer program,

244246

constant pointer, 246247 passing and returning,

247248

versus vectors, 117, 146147

Artificial Intelligence (AI), 203

ASCII (American Standard Code for Information Interchange), 22, 393396

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, 157158 Tic-Tac-Toe game, 208209

assembly language, 2 assigning values

to Boolean variables, 22

to character variables, 2122 to floating point variables, 21 to integer variables, 21

assignment operator (=), 21, 44,

313315, 346347

assignment statement, 70

associative container, 138