home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / listings / v_08_10 / 8n10084a < prev    next >
Text File  |  1990-08-20  |  592b  |  44 lines

  1.  
  2.  
  3. Listing 1
  4.  
  5. /*--- test.h ------------------------------------*/
  6. #ifdef MAIN
  7. #  define EXTERN
  8. #else
  9. #  define EXTERN extern
  10. #endif
  11.  
  12. EXTERN int i ;
  13.  
  14. /*--- test1.c (main file) -----------------------*/
  15.  
  16. #define MAIN
  17.  
  18. #include "test.h"
  19.  
  20. void main  (void) ;
  21. void test2 (void) ;
  22.  
  23. void main(void)
  24.   {
  25.   i = 3 ;
  26.   test2 () ;
  27.   }
  28.  
  29. #undef  MAIN
  30.  
  31. /*--- test2.c -----------------------------------*/
  32. #include "test.h"
  33.  
  34. int printf(const char *, ...);
  35.  
  36. void test2 (void)
  37.   {
  38.   printf("i is %d\n", i) ; 
  39.   }
  40. /*-----------------------------------------------*/
  41.  
  42.  
  43.  
  44.