home *** CD-ROM | disk | FTP | other *** search
/ Microsoft Programmer's Library 1.3 / Microsoft-Programers-Library-v1.3.iso / sampcode / qc_prog / chap06 / proto.c < prev    next >
Encoding:
C/C++ Source or Header  |  1988-04-05  |  489 b   |  21 lines

  1. /* proto.c -- demonstrate function prototyping */
  2. /*            and parameter checking           */
  3.  
  4. main()
  5. {
  6.     float n = 9995.997;
  7.     int i;
  8.     int examine(int num);  /* declare function */
  9.                            /* with prototype   */
  10.  
  11.     printf("n in main() is %f\n", n);
  12.     i = examine(n);    /* pass float to function */
  13.     printf("examine() returned n as %d\n", i);
  14. }
  15.  
  16. int examine(num)
  17. {
  18.     printf("examine() says n is %d\n", num);
  19.     return(num);
  20. }
  21.