Next: Parameter Values
Up: No Title
Back: No Title
-
Large complex programs can be divided into smaller manageable pieces
called functions
-
Each function has a unique name
-
Functions can return a value to the caller and can receive information
called parameters
-
If a function returns a value, you must specify the function's
return type (e.g., int, char) before the function
name;
otherwise, you should precede the function name with a void
-
If the function receives parameters, you must specify a unique
name for each parameter and a type; if the function does not receive
parameters, you should place the void keyword between the
parenthesis that follow the function name
-
C++ must know the function's return type and the number and type
of parameters the function receives; if the function definition
follows
the function's use, you must place a function prototype at the start
of your source file