Function declaration : The program or a function that called a function is referred to as the calling function or calling program. The calling program should declare any function that is to be used later in the program. This is known as the function declaration.
- Function type
- Function name
- Parameter list
- Terminating semicolon
They are coded in the following format :
Funtion_type function_name(parameter list);
Points to note :
- The parameter list must be separated by commas.
- If the function has no formal parameters, the list is written as void.
- The return type is optional when the function returns int type data.
- When the declared type does not match the types in the function definition compiler will produce an error.