< previous page page_409 next page >

Page 409
0409-01.gif
Figure 8-3
Returning a Function Value to the Expression That Called the Function
3e26ecb1b6ac508ae10a0e39d2fb98b2.gif 3e26ecb1b6ac508ae10a0e39d2fb98b2.gif
Function Value Type The data type of the result value returned by a function.
The last statement in the Day function evaluates the expression
(month - 1) * 30 + correction + dayOfMonth
and returns the result as the function value (see Figure 8-3).
You now have seen two forms of the return statement. The form
return;
is valid only in void functions. It causes control to exit the function immediately and return to the caller. The second form is
return Expression;
This form is valid only in a value-returning function. It returns control to the caller, sending back the value of Expression as the function value. (If the

 
< previous page page_409 next page >