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

  1. /* mixtypes.c -- shows problem with calling           */
  2. /*               a function with wrong type parameter */
  3.  
  4. main()
  5. {
  6.     /* didn't bother to declare int function */
  7.     float n = 5.0;
  8.     int i;
  9.  
  10.     printf("n in main() is %f\n", n);
  11.     i = examine(n);    /* pass float to function */
  12.     printf("examine() returned n as %d\n", i);
  13. }
  14.  
  15. examine(num)  /* function didn't declare return type */
  16. {
  17.     printf("examine() says n is %d\n", num);
  18.     return(num);
  19. }
  20.  
  21.