home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / vc98 / crt / src / fgetchar.c < prev    next >
C/C++ Source or Header  |  1998-06-17  |  1KB  |  48 lines

  1. /***
  2. *fgetchar.c - get a character from stdin
  3. *
  4. *       Copyright (c) 1985-1997, Microsoft Corporation. All rights reserved.
  5. *
  6. *Purpose:
  7. *       defines _fgetchar() and getchar() - read a character from stdin
  8. *       defines _fgetwchar() and getwchar() - read a wide character from stdin
  9. *
  10. *******************************************************************************/
  11.  
  12. #include <cruntime.h>
  13. #include <stdio.h>
  14.  
  15. /***
  16. *int _fgetchar(), getchar() - read a character from stdin
  17. *
  18. *Purpose:
  19. *       Reads the next character from stdin.  Function version of
  20. *       getchar() macro.
  21. *
  22. *Entry:
  23. *       None.
  24. *
  25. *Exit:
  26. *       Returns character read or EOF if at end-of-file or an error occured,
  27. *       in which case the appropriate flag is set in the FILE structure.
  28. *
  29. *Exceptions:
  30. *
  31. *******************************************************************************/
  32.  
  33. int __cdecl _fgetchar (
  34.         void
  35.         )
  36. {
  37.         return(getc(stdin));
  38. }
  39.  
  40. #undef getchar
  41.  
  42. int __cdecl getchar (
  43.         void
  44.         )
  45. {
  46.         return _fgetchar();
  47. }
  48.