Functions.....cont(1)

Declaring Vs Defining a function
The syntax of a function declaration is identical to the header of a function definistion, except that:
It does not include a statement for the function. Which means that it does not include the statement body with all the instructions that are usually enclosed within key brackets { }.
It ends with a semicolon(;).
In the argument enumeration, it is enough to write the type of each argument. The inclusion of a name for each argument is recommended, though optional as in the definition of a standard function.
Calling a function
In order for a function to be used, it must be called by another function. To call a function, one enters the name of the function followed by a matching pair of parentheses inside which is the list of parameter values to be passed to the function. The list is in the same order as in the declaration. The parameters included in function declarations are called formal parameters while the parameters listed in a function call are called the actual parameters.
For example, in order to invoke a function whose prototype is of the following format:
flaot volume(float, float,float);
the function call statement can be used:
volume(l,b,h);
where l,bh are float variables. LEARN MORE>>

No comments: