home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c021 / 7.img / EXAMPLES.ZIP / INTRO24.C < prev    next >
Encoding:
C/C++ Source or Header  |  1990-05-04  |  327 b   |  22 lines

  1. /* INTRO24.C--Example from Chapter 4 of Getting Started */
  2.  
  3. #include <stdio.h>
  4. #include <conio.h>
  5.  
  6. void tally(void);
  7.  
  8. int main()
  9. {
  10.    while ( getch() != 'q')
  11.       tally();
  12.  
  13.    return 0;
  14. }
  15.  
  16. void tally(void)
  17. {
  18.    static int called = 0;
  19.    called++;
  20.    printf("Function tally called %d times\n", called);
  21. }
  22.