Page t034, go to NEXT, PREVIOUS, INDEX

More on Declarations


Data can be external

      extern double pi;

      double pi = 3.1415;

Internal declaration

      #include <math.h>

      static double exp_random (double mu)
      { return -mu * log (random());
      }

      void simulation1 ()
      { /* declarations and code */
        double x1 = exp_random (2.1);
        /* more code */
      }

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