|
|
 |
|
|
|
|
freeing memory, 190, 238 |
|
|
|
 |
|
|
|
|
friend classes, 329, 345 |
|
|
|
 |
|
|
|
|
friend functions, 330 |
|
|
|
 |
|
|
|
|
functionality, 291, 387, See also methods |
|
|
|
 |
|
|
|
|
common, 298 |
|
|
|
 |
|
|
|
|
percolating, 299 |
|
|
|
 |
|
|
|
|
prototypes, 390 |
|
|
|
 |
|
|
|
|
shared, 294, 299 |
|
|
|
 |
|
|
|
|
functions, 13, 61 |
|
|
|
 |
|
|
|
|
abort(), 429 |
|
|
|
 |
|
|
|
|
accessing, 151 |
|
|
|
 |
|
|
|
|
accessor, 90, 99 |
|
|
|
 |
|
|
|
|
Add(), 26 |
|
|
|
 |
|
|
|
|
Area(), 63 |
|
|
|
 |
|
|
|
|
arguments, 69-71, 80-81, 167 |
|
|
|
 |
|
|
|
|
as parameters to functions, 69 |
|
|
|
 |
|
|
|
|
base class, hiding, 280 |
|
|
|
 |
|
|
|
|
bodies, 24-25, 64, 101 |
|
|
|
 |
|
|
|
|
calling, 21-23, 61, 70-71, 78 |
|
|
|
 |
|
|
|
|
parameters, 73 |
|
|
|
 |
|
|
|
|
stack frames, 80 |
|
|
|
 |
|
|
|
|
calls, 429 |
|
|
|
 |
|
|
|
|
class member |
|
|
|
 |
|
|
|
|
const, 99 |
|
|
|
 |
|
|
|
|
overloading, 193-195 |
|
|
|
 |
|
|
|
|
const member (const this pointer), 159 |
|
|
|
 |
|
|
|
|
constant (declaring accessor functions), 99 |
|
|
|
 |
|
|
|
|
dealing with strings, 241 |
|
|
|
 |
|
|
|
|
declarations, 62 |
|
|
|
 |
|
|
|
|
declaring, 62-64, 100 |
|
|
|
 |
|
|
|
|
declaring arrays of pointers to, 333-335 |
|
|
|
 |
|
|
|
|
defining, 62-64, 438 |
|
|
|
 |
|
|
|
|
definitions, 62-66, 92, 101 |
|
|
|
 |
|
|
|
|
declaring parameters, 73 |
|
|
|
 |
|
|
|
|
DemonstrationFunction(), 24 |
|
|
|
 |
|
|
|
|
executing, 23, 61 |
|
|
|
 |
|
|
|
|
exiting, 25 |
|
|
|
 |
|
|
|
|
FindArea(), 64 |
|
|
|
 |
|
|
|
|
friend, 330 |
|
|
|
 |
|
|
|
|
global, 345 |
|
|
|
 |
|
|
|
|
headers, 24, 64, 172 |
|
|
|
 |
|
|
|
|
class definitions, 101 |
|
|
|
 |
|
|
|
|
function names, 24 |
|
|
|
 |
|
|
|
|
parameters, 24-25 |
|
|
|
 |
|
|
|
|
return types, 24 |
|
|
|
 |
|
|
|
|
function implementations, 101. See also definitions |
|
|
|
 |
|
|
|
|
initializing, 289-290 |
|
|
|
 |
|
|
|
|
inline, 102-104 |
|
|
|
 |
|
|
|
|
declaring, 76-78 |
|
|
|
 |
|
|
|
|
disadvantages, 76 |
|
|
|
 |
|
|
|
|
invoking, 23 |
|
|
|
 |
|
|
|
|
local variables, 66 |
|
|
|
 |
|
|
|
|
macro, 352-353, 370 |
|
|
|
 |
|
|
|
|
main(), 21-23, 26, 61, 70-71, 351 |
|
|
|
 |
|
|
|
|
member, 87. See also methods |
|
|
|
 |
|
|
|
|
arrays of pointers, 342-344 |
|
|
|
 |
|
|
|
|
declaring default values, 196-198 |
|
|
|
 |
|
|
|
|
pointers, 340-342 |
|
|
|
 |
|
|
|
|
static, 320, 345 |
|
|
|
 |
|
|
|
|
virtual, 271 |
|
|
|
 |
|
|
|
|
memory, 189-190 |
|
|
|
 |
|
|
|
|
names, 24, 330, 436 |
|
|
|
 |
|
|
|
|
as address, 340 |
|
|
|
 |
|
|
|
|
naming conventions, 88 |
|
|
|
 |
|
|
|
|
overloaded (default values), 205 |
|
|
|
 |
|
|
|
|
overloading, 75-76, 81 |
|
|
|
 |
|
|
|
|
advantages, 198, 205 |
|
|
|
 |
|
|
|
|
parameters, 75 |
|
|
|
 |
|
|
|
|
return types, 75 |
|
|
|
 |
|
|
|
|
when to use, 198 |
|
|
|
 |
|
|
|
|
overriding, 260 |
|
|
|
 |
|
|
|
|
parameters, 66 |
|
|
|
 |
|
|
|
|
passing pointers to functions to, 335, 338 |
|
|
|
 |
|
|
|
|
pointers, 330 |
|
|
|
 |
|
|
|
|
declaring, 330, 333 |
|
|
|
 |
|
|
|
|
dereferencing, 333 |
|
|
|
 |
|
|
|
|
typedef, 338-339 |
|
|
|
 |
|
|
|
|
polymorphism (overloading), 75 |
|
|
|
 |
|
|
|
|
private, 266 |
|
|
|
 |
|
|
|
|
protected, 252 |
|
|
|
 |
|
|
|
|
prototypes, 62-65, 73, 171. See also statements |
|
|
|
 |
|
|
|
|
public, 266 |
|
|
|
 |
|
|
|
|
return addresses (stacks), 80 |
|
|
|
 |
|
|
|
|
return types, 65 |
|
|
|
 |
|
|
|
|
returning |
|
|
|
 |
|
|
|
|
values, 65, 71-73, 78 |
|
|
|
 |
|
|
|
|
void, 71, 78 |
|
|
|
 |
|
|
|
|
signatures, 25, 261 |
|
|
|
 |
|
|
|
|
sizeof(), 30 |
|
|
|
 |
|
|
|
|
SomeFunction() (constant member function), 99 |
|
|
|
 |
|
|
|
|
statements, 25, 69 |
|
|
|
 |
|
|
|
|
storing, 299 |
|
|
|
 |
|
|
|
|
strcpy(), 241-242 |
|
|
|
 |
|
|
|
|
strncpy(), 241-242 |
|
|
|
 |
|
|
|
|
stubbing out, 249 |
|
|
|
 |
|
|
|
|
swap(), 70-71 |
|
|
|
 |
|
|
|
|
changing parameters, 171 |
|
|
|
 |
|
|
|
|
pointers, 168-170 |
|
|
|
 |
|
|
|
|
references, 170-171 |
|
|
|
 |
|
|
|
|
templates, 420 |
|
|
|
 |
|
|
|
|
terminate(), 429 |
|
|
|
 |
|
|
|
|
virtual, 272, 280, 299 |
|
|
|
 |
|
|
|
|
invoking, 273-275 |
|
|
|
 |
|
|
|
|
non-pure, 291, 294, 297-298 |
|
|
|
 |
|
|
|
|
pure, 289-290, 294, 297-299. See also virtual functions, pure virtual member, 382 |
|
|
|
 |
|
|
|
|
global data, 345 |
|
|
|
 |
|
|
|
|
global functions, 345 |
|
|
|
 |
|
|
|
|
global name space, 143 |
|
|
|
 |
|
|
|
|
global scope, 68 |
|
|
|
 |
|
|
|
|
global variables, 68, 81 |
|
|
|
 |
|
|
|
|
free store, 143 |
|
|
|
 |
|
|
|
|
global name space, 143 |
|
|
|
 |
|
|
|
|
global scope, 68 |
|
|
|
 |
|
|
|
|
goto loops |
|
|
|
 |
|
|
|
|
disadvantages, 112 |
|
|
|
 |
|
|
|
|
example, 111-112 |
|
|
|
 |
|
|
|
|
greater than operator (>), 50-51, 151 |
|
|
|
 |
|
|
|
|
greater than or equal to operator (>=), 50-51 |
|
|
|
 |
|
|
|
|
groups (large), programming in, 392-393 |
|
|
|
|
|