home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / listings / v_12_09 / allison / autoconv.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-07-10  |  441 b   |  37 lines

  1. #include <stdio.h>
  2.  
  3. void f2(int,double);
  4.  
  5. main()
  6. {
  7.     f1(1,3);
  8.     f1(1.0, 3.0);
  9.  
  10.     f2(1,3);
  11.     f2(1.0,3.0);
  12.     f2(1.0e6,3.0e6);
  13.     return 0;
  14. }
  15.  
  16. f1(x,y)     /* Old-style function declaration */
  17. int x;
  18. double y;
  19. {
  20.     printf("%d, %f\n",x,y);
  21. }
  22.  
  23. void f2(int x, double y)
  24. {
  25.     printf("%d, %f\n",x,y);
  26. }
  27.  
  28. /* Output:
  29. 1, 0.000000
  30. 1, 3.000000
  31. 1, 3.000000
  32. 1, 3.000000
  33. 1, 3.000000
  34. 16960, 3000000.000000
  35. */
  36.  
  37.