< previous page page_376 next page >

Page 376
rameters' positions in each list. Copies of the values of size and initial are passed to the function; the location (memory address) of length is passed to the function. c. size and initial are protected from change because it is only copies of their values that are sent to the function. 6. In the block that forms the body of the function. Their initial values are undefined. 7. a. There will be two parameters: an int containing the number of values to be read and a float containing the computed average. b. The int should be a value parameter; the float should be a reference parameter. 8. The coding may be simplified if the function is called from more than one place in the program.
Exam Preparation Exercises
1. Define the following terms:
function call
formal parameter
parameter list
actual parameter
parameterless function
local variable

2. Identify the following items in the program fragment shown below.
function prototype
function definition
function heading
formal parameters
actual parameters
function call
local variables
function body

3e26ecb1b6ac508ae10a0e39d2fb98b2.gif
void Test( int, int, int );

int main()
{
    int a;
    int b;
    int c;
    .
    .
    .
    Test(a, c, b);
    Test(b, a, c);
    .
    .
    .
}

void Test( int d,
           int e,
           int f )
{
    int g;
    int h;
    .
    .
    .
}

 
< previous page page_376 next page >