< Previous | Contents | Next >

F

false values

interpreting, 43

testing, 42–43

find() algorithm, 134

find() member function, 94–95 Finicky Counter program,

58–60

float type, 19tbl

floating points, 14, 21

for loops, 81–87

Counter program, 82–84

counting with, 84–85 defining variables inside, 166 nesting, 86–87

using empty statements in, 85 FORTRAN language, 112 forward slash (/), 14

free store, 296, 325. See also heap freeing memory, 300

Friend Critter program, 292–294

friend functions, 325

creating, 295

Friend Critter program, 292–294

function body, 154

function header, 154

function inlining, 184

functions, 8, 35, 151–186

abstraction, 155 accepting values into

parameters, 158–160

calling, 70, 154 calling with default

arguments, 173

declaring, 153, 183

default arguments, 171–174 assigning to parameters,

173–174

Give Me a Number program, 171–172

overriding, 174

specifying, 173

defining, 154

encapsulation, 160

global constants, 170

global variables, 166–170

accessing, 168

altering, 169

declaring, 168

Global Reach program, 166–168

hiding, 169 minimizing use of, 170

inlining, 177–180

calling, 179–180

specifying, 179

Taking Damage program, 177–179

Instructions program, 152–153 Mad Lib game, 180–183

askNumber()function, 182

askText()function, 182

main()function, 181–182

setting up, 181

tellStory()function, 183

overloading, 174–177, 184

calling, 177

creating, 176

Triple program, 174–176

prototype, 153, 159

return values, 157–158

return statement, 158 specifying return type, 157 using, 158

scopes, 161–166

nested, 165–166

Scoping program, 161–163

separate, 163–164

software reuse, 161

Tic-Tac-Toe game, 206tbl Yes or No program, 155–157

fundamental types, 18