< previous page
page_389
next page >
Page 389
8
Scope, Lifetime, and More on Functions
GOALS
To be able to do the following tasks, given a C++ program composed of several functions:
Determine whether a variable is being referenced globally.
Determine which variables are local variables.
Determine which variables are accessible within a given block.
To be able to determine the lifetime of each variable in a program.
To understand and be able to avoid unwanted side effects.
To know when to use a value-returning function.
To be able to design and code a value-returning function for a specific task.
To be able to invoke a value-returning function properly.
< previous page
page_389
next page >