Return
To COSI 216 - HOME
Return
to Handout
Return to Course Outline
Return to Chapter Seven
Function header:
-
A return data type
-
A function name
-
A paramater listing
For example:
-
float Average(float
X, float Y, float Z)
-
int Max
(int A, int B, int C, int D, int E)
Click here to
see MAX5 program.
-
char Redo()
-
void PrintHeader()
-
void Swap(int
&X,
int &Y)
By the end of function, if you have a "return"
statement,
which kind of data type you return to the caller has
to be
listed in the beginning of function header.
If main() calls
Max(), then main()
is the caller.
It is not user as caller.
Note: When a function does not return
any value
to the calling program (Caller)
or return more than one value,
you must use the keyword void as the
return class.