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

  1. /***
  2. *fputchar.c - write a character to stdout
  3. *
  4. *       Copyright (c) 1985-1997, Microsoft Corporation. All rights reserved.
  5. *
  6. *Purpose:
  7. *       defines _fputchar(), putchar() - write a character to stdout, function version
  8. *       defines _fputwchar(), putwchar() - write a wide character to stdout, function version
  9. *
  10. *******************************************************************************/
  11.  
  12. #include <cruntime.h>
  13. #include <stdio.h>
  14.  
  15. /***
  16. *int _fputchar(ch), putchar() - put a character to stdout
  17. *
  18. *Purpose:
  19. *       Puts the given characters to stdout.  Function version of macro
  20. *       putchar().
  21. *
  22. *Entry:
  23. *       int ch - character to output
  24. *
  25. *Exit:
  26. *       returns character written if successful
  27. *       returns EOF if fails
  28. *
  29. *Exceptions:
  30. *
  31. *******************************************************************************/
  32.  
  33. int __cdecl _fputchar (
  34.         REG1 int ch
  35.         )
  36. {
  37.         return(putc(ch, stdout));
  38. }
  39.  
  40. #undef putchar
  41.  
  42. int __cdecl putchar (
  43.         int ch
  44.         )
  45. {
  46.         return _fputchar(ch);
  47. }
  48.