< Previous | Contents | Next >

I

IDE (Integrated Development Environment), 3–4

identifier, 20, 31

if statements, 39–45

defining variables inside, 166 with else clauses, 48–51

creating sequence of, 50–51 Score Rater 3.0 program,

49–50

nesting, 44–45

relational operators, 44 Score Rater program, 41–42 true and false values

interpreting, 43

testing, 42–43

increment operator (þþ), 27–28

indexing

arrays, 99–100 multidimensional arrays,

105–106

string objects, 93

vectors, 121

infinite loop, 58, 78–79

inheritance, 331–346, 356–380

base class member functions, 340–346

calling, 345–346 calling base class constructors,

343–344

declaring virtual, 344 Overriding Boss program,

341–343

overriding virtual, 344–345

Blackjack game, 356–379

Card class, 361–363

Deck class, 370–373

designing classes, 356–360

Game class, 373–376

GenericPlayer class, 366–367

Hand class, 363–366

House class, 369–370

main() function, 376–377 overloading the

operator()

function, 377–379 planning game logic,

360–361

Player class, 368–369 controlling access under,

337–340

access modifiers, 339–340 Simple Boss 2.0 program,

338–339

deriving from base classes, 335–336

inherited members, 337 instantiating objects from

derived classes, 336–337 overloaded assignment

operators and copy constructors, 346–347

Simple Boss program, 333–335

initialization statement, for

loop, 82

initializer list, 99 initializing

constant pointer, 231

pointers, 227, 250

references, 189

static data members, 272 variables, 22

inlining functions, 177–180, 268,

282

calling inlined functions, 179–180

specifying functions for, 179 Taking Damage program,

177–179

inner loop, 86–87

insert()vector member function, 130

instances, class, 259

instantiating objects, 259, 263

instructions() function

Mad Lib game, 154 Tic-Tac-Toe game, 208

Instructions program, 152–153

int type, 18, 19tbl, 112

int argument, 175

int GetTotal() const member,

BlackJack Hand class, 359

int GetValue() member,

BlackJack Card class, 359 integer division, 14–15

integer variables, 21 integer wrap around, 26,

28–29

integers, 14, 78 Integrated Development

Environment (IDE), 3–4

intOnHeap() function, 300 Inventory Displayer program,

195–196

Inventory Pointer program, 239–240

iostream file, 8–9, 36

isLegal()function, Tic-Tac-Toe game, 212–213

ISO standard, 5

iterating through string objects, 93–94

iterators, 123–131

accessing member functions of vector element, 129–130

changing value of vector element, 128–129

declaring, 125–126

defined, 116, 146

erase()vector member function, 130–131

Hero's Inventory 3.0 program, 123–125

insert()vector member function, 130

Index 405‌


looping through vector, 126–128 altering an iterator, 128 calling begin()vector

member function, 127 calling end()vector

member function, 127–128

dereferencing an iterator, 128

vector member functions and, 147