< Previous | Contents | Next >

V

values

See also assigning values data member, accessing, 260 displaying, 22–23

references

accessing, 190

altering, 190–191 returning from main()

function, 10

variables, 16–24

assigning returning references, 202

assigning values, 21–22

to Boolean variables, 22

to character variables, 21–22 to floating point variables, 21 to integer variables, 21

declaring, 19–20 defining new names

for types, 23

displaying values, 22–23

fundamental types, 18 Game Stats program, 16–17 getting user input, 23 global. See global variables initializing, 22

naming, 20–21 performing arithmetic

operations, 24–29

altering value of variable, 26 combined assignment

operators, 26–27

decrement operator, 27–28 Game Stats 2.0 program,

24–26

increment operator, 27–28 integer wrap around, 28–29

scopes, 161

type modifiers, 18–19 understanding which types to

use, 24

vector member functions, 115

vector objects, 115 vector STL container, 139 vector<Card*> m_Cards

member, BlackJack Hand class, 359

vector<Player> m_Players member, BlackJack Game class, 360

vectors, 116–122, 136–138

versus arrays, 146–147 calling member functions of

element, 121–122

clear()member function, 122

declaring, 119–120

defined, 146

element insertion and deletion, 138

empty()member function, 122

growth, 136–137

capacity()member function, 136–137

reserve()member function, 137

Hero's Inventory 2.0 program, 117–119

indexing, 121

looping iterators through, 126–128

altering iterator, 128 calling begin()vector

member function, 127 calling end()vector member

function, 127–128

dereferencing iterator, 128

pop_back()member function, 122

preparing to use, 119

push_back() member function, 120

size()member function, 120

410 Index‌



virtual base class member functions, 344–345

virtual bool IsHitting() const = 0 member, BlackJack GenericPlayer class, 359

virtual bool IsHitting() const member

BlackJack House class, 360 BlackJack Player class, 359

virtual destructors, 347

virtual functions, 354–355, 380

virtual keyword, 268, 365

void Add(Card* pCard) member,

BlackJack Hand class, 359

void AdditionalCards member,

BlackJack Deck class, 360

void Bust() const member, BlackJack GenericPlayer class, 359

void Clear() member, BlackJack

Hand class, 359

void Deal(Hand& aHand) member, BlackJack Deck class, 360


void Flip() member, BlackJack

Card class, 359

void FlipFirstCard() member,

BlackJack House class, 360

void Lose() const member,

BlackJack Player class, 359

void Play() member, BlackJack

Game class, 360

void Populate() member,

BlackJack Deck class, 360

void Push() const member,

BlackJack Player class, 359

void setDisplay prototype, 173–174

void Shuffle() member,

BlackJack Deck class, 360

void Win() const member, BlackJack Player class, 359