< Previous | Contents | Next >

C

C programming language, 36 Cþþ program, 510

commenting code, 7 creating first program with,

383388

Index 401


displaying text through standard defining member functions, Constructor Critter program,

output, 89 258259 261262

Game Over program, 56 instatiating objects, 259 constructors, 260264

including other files, 78 Simple Critter program, base class, 379

main() function, 8, 10 256257 calling automatically, 263264 terminating statements, 9 setting member access levels, Constructor Critter program, whitespace, 7 264269 261262

calling defining accessor member declaring and defining, base class member functions, functions, 267268 262263

345346 defining constant member defined, 282

constructors, 263264 functions, 268269 instantiating objects from

end()vector member function, Private Critter program, derived class, 336 127128 264266 containers

functions, 70, 154 specifying public and adaptors, 147

inlined functions, 179180 private, 266267 associative, 138 member functions, 260 static data members data members, 291292 overloaded functions, 177 accessing, 272273 defined, 145

static member functions, declaring, 272 sequential, 138139 273274 initializing, 272 continue statement, 59, 61,

camel case, 20 Static Critter program, 77, 111

capacity()member function, 270271 copy constructors, 326

136137 static member functions declaring, 309313

Card class, BlackJack, 357, calling, 273274 defining, 309313

359, 361363 declaring, 273 using in derived classes,

case sensitivity, 20, 38, 258 defining, 273 346347

cctype file, 142 Static Critter program, Counter program, 8284

change_global() function, 169 270271 cout object, 89, 36

char type, 19tbl, 112 clear()member function, 122 Critter Caretaker game, 274281 char value, 158 code profiling, 185186 Critter class, 277280 character variables, 2122 combined assignment operators, class constructor, 277278 cin object, 36 2627 class definition, 277

classes, 255283 commenting code, 7 Eat() member function,

See also advanced classes comments, 7, 37 279280

constructors, 260264 compile errors, 4 GetMood() member calling automatically, compiler, defined, 2 function, 278

263264 compiler warning, 37 PassTime() member Constructor Critter computerMove()function, function, 278

program, 261262 Tic-Tac-Toe game, Play() member function, declaring and defining, 213216 280

262263 concatenating string objects, 92 Talk() member function, Critter Caretaker game, const keyword, 170, 234, 279

274281 249, 251, 269 main() function, 280281

Critter class, 277280 constant iterator, 126 planning game, 275276 main() function, 280281 constant member functions, planning pseudocode, planning game, 275276 268269 276

planning pseudocode, 276 constant pointer, 246247, 249 Critter Farm program,

defined, 282 constant reference, 197198, 218 288290

defining new types, 255260 constants, 2932 cstdlib file, 78

accessing data members, defined, 36 cstring file, 102

259260 enumerations, 3132 C-style comments, 7

calling member functions, Game Stats 3.0 program, C-style strings, 101102

260 2930 curly braces

declaring data members, 258

global, 170

functions, 8

declaring member

overview, 31

nested scopes, 165

functions, 258

pointers and, 231234

scopes, 163

402 Index