Page t031, go to NEXT, PREVIOUS, INDEX

Declarations and Definitions


Programs must be broken up into units which are compiled separately

Functions and other externals must be declared before their use

      extern double sqrt (double);

      double x, y, z, r;
      /* initialization, etc. */
      r = sqrt (x*x + y*y + z*z);

What would happen if the declaration we used did not correspond to the function definition in the library?

To ensure consistency, we must force the library function and the function we use in a program to share the same declaration


C Course, 21-jan-1997, Peter Klok, pfk@hef.kun.nl