next up previous contents index
Next: Passing arrays, structs and Up: Declaring and using functions Previous: Pass by value and   Contents   Index


Calling functions defined anywhere in your program: prototypes

You should only call a function after it has been declared, otherwise parameter type checking is not performed. However you do not have to define a function when you declare it:

  
float my_mean(float, float, float);  /*  declares a function my_mean  */
You can call my_mean from any point below the declaration, because the compiler can generate code for a call to my_mean from just the information provided here. The function can now be defined anywhere, even at the bottom of the program, (or maybe in some external library).



CATAM admin 2010-02-23