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

  1. /*     getche.c -- using getche()             */
  2. #include <conio.h>     /* note different file included */
  3. main()
  4. {
  5.     int count = 1;
  6.  
  7.     printf("Please enter a word.\n");
  8.     while (getche() != '\r')    /* changed comparison */
  9.         printf("%d.. ", count++); 
  10.     printf("\n%d characters altogether\n", count - 1);
  11. }
  12.