home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / listings / v_09_01 / 9n01048a < prev    next >
Text File  |  1990-11-14  |  428b  |  34 lines

  1.  
  2.  
  3.                                 Listing 1
  4.                     Function Definitions for K&R and ANSI
  5.  
  6.  
  7. #define ANSI 1
  8. #include <stdio.h>
  9. #include <myheader.h>
  10.  
  11. int main()
  12. {
  13.    int i;
  14.  
  15.    for (i = 0; i < 10; i++)
  16.       printf("\n%d", func1(i));
  17. }
  18.  
  19.  
  20. #ifdef ANSI
  21.  
  22. int func1(int i)  /* For an ANSI compiler */
  23.  
  24. #else
  25.  
  26. int func1(i)      /* For a K&R compiler */
  27. int i;
  28.  
  29. #endif
  30. {
  31.    return i * i;
  32. }
  33.  
  34.