|
|
 |
|
|
|
|
methods, 388 |
|
|
|
 |
|
|
|
|
naming, 387 |
|
|
|
 |
|
|
|
|
root objects, 387 |
|
|
|
 |
|
|
|
|
rooted hierarchies, 386-387 |
|
|
|
 |
|
|
|
|
runtime, 17 |
|
|
|
 |
|
|
|
|
bugs, 299 |
|
|
|
 |
|
|
|
|
errors, finding, 101 |
|
|
|
 |
|
|
|
|
runtime types, 299 |
|
|
|
 |
|
|
|
|
saving files, 11, 348 |
|
|
|
 |
|
|
|
|
scope, global, 68 |
|
|
|
 |
|
|
|
|
scoping operator (::), 340 |
|
|
|
 |
|
|
|
|
self-assigned addition operator (+=), 46 |
|
|
|
 |
|
|
|
|
semicolon (;), 41, 126 |
|
|
|
 |
|
|
|
|
setting aside memory, 28 |
|
|
|
 |
|
|
|
|
setting up |
|
|
|
 |
|
|
|
|
environment variables, 15 |
|
|
|
 |
|
|
|
|
include path, 15 |
|
|
|
 |
|
|
|
|
shallow copies, 200, 216 |
|
|
|
 |
|
|
|
|
shared functionality, 299 |
|
|
|
 |
|
|
|
|
sharing knowledge, 393 |
|
|
|
 |
|
|
|
|
short int variables, 29 |
|
|
|
 |
|
|
|
|
short signed integers, 30 |
|
|
|
 |
|
|
|
|
short unsigned integers, 30 |
|
|
|
 |
|
|
|
|
short variable types, 35 |
|
|
|
 |
|
|
|
|
short variables (size), 40 |
|
|
|
 |
|
|
|
|
shorthand invocations, 333 |
|
|
|
 |
|
|
|
|
signatures (functions), 25, 261 |
|
|
|
 |
|
|
|
|
signed integers, 30 |
|
|
|
 |
|
|
|
|
signed short variables (size), 35 |
|
|
|
 |
|
|
|
|
signed variable types, 30 |
|
|
|
 |
|
|
|
|
signed variables, wrapping around, 36-37 |
|
|
|
 |
|
|
|
|
simple text files (writing programs), 11 |
|
|
|
 |
|
|
|
|
simple windows, 11 |
|
|
|
 |
|
|
|
|
simulations, 376 |
|
|
|
 |
|
|
|
|
singly linked lists, 302 |
|
|
|
 |
|
|
|
|
size |
|
|
|
 |
|
|
|
|
class methods, 98 |
|
|
|
 |
|
|
|
|
class objects, 98 |
|
|
|
 |
|
|
|
|
cubby holes, 28 |
|
|
|
 |
|
|
|
|
objects (user-created), 178 |
|
|
|
 |
|
|
|
|
variables, 29, 32 |
|
|
|
 |
|
|
|
|
determining, 30 |
|
|
|
 |
|
|
|
|
signed short, 35 |
|
|
|
 |
|
|
|
|
unsigned long, 35 |
|
|
|
 |
|
|
|
|
unsigned short, 35 |
|
|
|
 |
|
|
|
|
sizeof() function, 30 |
|
|
|
 |
|
|
|
|
slash (/) (division operator), 45 |
|
|
|
 |
|
|
|
|
slash-star (/*) comments, 22, 26 |
|
|
|
 |
|
|
|
|
slicing, 273-275 |
|
|
|
 |
|
|
|
|
solution space, 378 |
|
|
|
 |
|
|
|
|
SomeFunction(), 99 |
|
|
|
 |
|
|
|
|
source code, 11 |
|
|
|
 |
|
|
|
|
files, 348 |
|
|
|
 |
|
|
|
|
intermediate, 355 |
|
|
|
 |
|
|
|
|
preprocessors, 347-348 |
|
|
|
 |
|
|
|
|
turning into programs, 12 |
|
|
|
 |
|
|
|
|
source files, 11 |
|
|
|
 |
|
|
|
|
spaghetti code, 112 |
|
|
|
 |
|
|
|
|
stack, 78, 234 |
|
|
|
 |
|
|
|
|
cleaning, 144 |
|
|
|
 |
|
|
|
|
frames, 80 |
|
|
|
 |
|
|
|
|
functions, 80 |
|
|
|
 |
|
|
|
|
last-in first-out, 78 |
|
|
|
 |
|
|
|
|
local variables, 80, 143 |
|
|
|
 |
|
|
|
|
pointers, 79 |
|
|
|
 |
|
|
|
|
return type, 80 |
|
|
|
 |
|
|
|
|
standard C++, 10 |
|
|
|
 |
|
|
|
|
Standard Template Library (STL), 420 |
|
|
|
 |
|
|
|
|
star-slash (*/) comments, 22, 26 |
|
|
|
 |
|
|
|
|
statements, 41-44, 62. See also commands; functions, |
|
|
|
 |
|
|
|
|
prototypes; operators |
|
|
|
 |
|
|
|
|
#define, 111, 348. See also loops |
|
|
|
 |
|
|
|
|
assert(), 359, 439 |
|
|
|
 |
|
|
|
|
break, 115-117 |
|
|
|
 |
|
|
|
|
catch, 429 |
|
|
|
 |
|
|
|
|
catch(), 429 |
|
|
|
 |
|
|
|
|
compound, 42 |
|
|
|
 |
|
|
|
|
continue, 115-117 |
|
|
|
 |
|
|
|
|
cout (string constants), 239 |
|
|
|
 |
|
|
|
|
default, 429 |
|
|
|
 |
|
|
|
|
expressions, 43 |
|
|
|
 |
|
|
|
|
evaluating, 43-44 |
|
|
|
 |
|
|
|
|
examples, 43 |
|
|
|
 |
|
|
|
|
functions, 25, 69 |
|
|
|
 |
|
|
|
|
if, 51 |
|
|
|
 |
|
|
|
|
braces, 55-57 |
|
|
|
 |
|
|
|
|
complex, 53-55 |
|
|
|
 |
|
|
|
|
inline, 76 |
|
|
|
 |
|
|
|
|
logical AND, 57-58 |
|
|
|
 |
|
|
|
|
logical NOT, 58 |
|
|
|
 |
|
|
|
|
logical OR, 58 |
|
|
|
 |
|
|
|
|
null (for loops), 123-125 |
|
|
|
 |
|
|
|
|
precompiler, 348 |
|
|
|
 |
|
|
|
|
print, 249 |
|
|
|
 |
|
|
|
|
programming tips, 43 |
|
|
|
 |
|
|
|
|
return, 25, 65, 71 |
|
|
|
 |
|
|
|
|
switch, 127, 429 |
|
|
|
 |
|
|
|
|
example, 128-129 |
|
|
|
 |
|
|
|
|
indenting, 435 |
|
|
|
 |
|
|
|
|
syntax, 127-128 |
|
|
|
 |
|
|
|
|
typedef, 338-339 |
|
|
|
 |
|
|
|
|
watch, 371 |
|
|
|
 |
|
|
|
|
whitespace, 42 |
|
|
|
 |
|
|
|
|
static data, 345 |
|
|
|
 |
|
|
|
|
static member data, 317-320 |
|
|
|
 |
|
|
|
|
static member functions, 320, 345 |
|
|
|
 |
|
|
|
|
static member variables, 318 |
|
|
|
 |
|
|
|
|
STL (Standard Template Library), 420 |
|
|
|
 |
|
|
|
|
stored objects, 387-388 |
|
|
|
 |
|
|
|
|
storing |
|
|
|
 |
|
|
|
|
addresses (pointers), 137 |
|
|
|
 |
|
|
|
|
arrays |
|
|
|
 |
|
|
|
|
free store, 234-235 |
|
|
|
 |
|
|
|
|
stack, 234 |
|
|
|
 |
|
|
|
|
data (arrays), 225 |
|
|
|
 |
|
|
|
|
functions, 299 |
|
|
|
 |
|
|
|
|
memory addresses (this pointer), 155 |
|
|
|
 |
|
|
|
|
stray pointers, 156 |
|
|
|
 |
|
|
|
|
strcpy() function, 241-242 |
|
|
|
 |
|
|
|
|
String classes, 242, 325-327 |
|
|
|
 |
|
|
|
|
string substitutions, 348 |
|
|
|
 |
|
|
|
|
stringizing operator (#), 355-356 |
|
|
|
 |
|
|
|
|
strings, 239-240 |
|
|
|
 |
|
|
|
|
constants (cout statements), 239 |
|
|
|
 |
|
|
|
|
defining, 349 |
|
|
|
 |
|
|
|
|
functions for dealing with, 241 |
|
|
|
 |
|
|
|
|
manipulating, 355 |
|
|
|
 |
|
|
|
|
substituting, 352-353 |
|
|
|
 |
|
|
|
|
strncpy() function, 241-242 |
|
|
|
 |
|
|
|
|
struct keyword, 109 |
|
|
|
 |
|
|
|
|
structured programming, 6-7 |
|
|
|
 |
|
|
|
|
stubbing out, 249 |
|
|
|
 |
|
|
|
|
style (writing code), 434 |
|
|
|
 |
|
|
|
|
subscript operator, 235-236 |
|
|
|
 |
|
|
|
|
subscripts |
|
|
|
 |
|
|
|
|
arrays, 225-226 |
|
|
|
 |
|
|
|
|
multidimensional arrays, 231-232 |
|
|
|
|
|