< Previous | Contents | Next >

D

dangling pointers, 241, 250–251,

301, 325

data members, 87, 110

accessing, 259–260

container, 291–292

declaring, 258

heap and, 303–315

declaring and defining copy constructors, 309–313

declaring and defining destructors, 308–309

declaring data members that point to values on heap, 307–308

Heap Data Member program, 303–307

overloading assignment operator, 313–315

object, 290–291

Deck class, BlackJack, 357, 360,

370–373

Deck m_Deck member, BlackJack

Game class, 360 declaring

constructors, 262–263

copy constructors, 309–313

data members, 258, 307–308

destructors, 308–309

functions, 153, 183

iterators, 125–126

member functions, 258

multidimensional arrays, 105

pointers, 226–227, 249

references, 189

static data members, 272 static member functions, 273 variables, 19–20, 165

vectors, 119–120

deep copy, 310, 326 default arguments, 171–174, 184

assigning to parameters, 173–174

Give Me a Number program, 171–172

overriding, 174

specifying, 173

default assignment operator, 313, 326

default constructor, 262–263, 284

default copy constructor, 309, 326

default destructor, 308

default keyword, 77

default statement, 51

defining

accessor member functions, 267–268

constant member functions, 268–269

constructors, 262–263

copy constructors, 309–313

destructors, 308–309

enumerations, 31–32

functions, 154

member functions, 258–259, 282 new names for types, 23

new types, 255–260 accessing data members,

259–260

calling member functions, 260

declaring data members, 258 declaring member

functions, 258

defining member functions, 258–259

instatiating objects, 259 Simple Critter program,

256–257

static member functions, 273 variables inside switch

statements, 166

virtual destructors, 351–352

delete operator, 300–301, 325 deque STL container, 139 dereference operator (*), 128, 146,

230

dereferencing

iterators, 128

pointers, 228–229, 249

derived classes, 379

from base classes, 335–336 deriving from abstract classes,

355–356

instantiating objects from, 336–337

using access modifiers when deriving, 340

using base class pointers to objects, 350–351

using overloaded assignment operators and copy constructors in, 346–347

Designers Network Program, 62–65

destructors, 326

base class, 379

declaring, 308–309

defining, 308–309

instantiating objects from derived class, 336

virtual, 347

when to make virtual, 381 Die Roller program, 68–69 display() function

constant referencees and, 197 passing and returning arrays,

247–248

displayBoard()function,

Tic-Tac-Toe game, 210–211

do loops, 56–58, 77

logical NOT operator, 66 overview, 57–58

Play Again 2.0 program, 56–57

dot operator, 230 double type, 18, 19tbl double-ended queue, 148

dynamic array, 116 dynamic memory

allocating, 296–303

avoiding memory leaks, 301– 303

delete operator, 300–301

Heap program, 297–299

new operator, 299–300 data members and heap,

303–315

copy constructors, 309–313

declaring, 307–308

destructors, 308–309 Heap Data Member

program, 303–307 overloading assignment op-

erator, 313–315