< 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:
3e26ecb1b6ac508ae10a0e39d2fb98b2.gif
Determine whether a variable is being referenced globally.
3e26ecb1b6ac508ae10a0e39d2fb98b2.gif
Determine which variables are local variables.
3e26ecb1b6ac508ae10a0e39d2fb98b2.gif
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 >