Functions
Functions
double x;
x = pow(2.0, 10.0);
Returning a Value From a
Function
• In a value-returning function, the return
statement can be used to return a value from
function to the point of call. Example:
(Program Continues)
statNum is automatically initialized to
0. Notice that it retains its value between
function calls.
If you do initialize a local static variable, the
initialization only happens once. See Program 6-23.