Function Prototype
- Functions must be declared before they are used or defined.
- A function declaration is called a function
prototype in C.
Examples of function prototypes
double sqrt ( double n ) ;
int FindMinimum (int n1, int n2);
void PrintInstructions (void);
General form
return-type Name ( arg1, arg2, ... argn ) ;
- return-type is the datatype of the value that is returned
by function.
- Name is the function's name
- argi's specify the types of the function's arguments
by giving the argument's data type and (optionally) a descriptive variable
name
Void
- if a function does not return a value, void
is used as the return-type
- if a function takes no arguments, void
is used as the argument specifier