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

  1. /***
  2. * istrchar.cpp - definitions for istream class operator>>(char&)
  3. *
  4. *       Copyright (c) 1991-1997, Microsoft Corporation.  All rights reserved.
  5. *
  6. *Purpose:
  7. *       Definitions of member function for istream operator>>(char&).
  8. *       [AT&T C++]
  9. *
  10. *******************************************************************************/
  11.  
  12. #include <cruntime.h>
  13. #include <internal.h>
  14. #include <stdlib.h>
  15. #include <iostream.h>
  16. #pragma hdrstop
  17.  
  18. istream& istream::operator>>(char& c)
  19. {
  20.     int tchar;
  21.     if (ipfx(0))
  22.         {
  23.         tchar=bp->sbumpc();
  24.         if (tchar==EOF)
  25.             {
  26.             state |= ios::eofbit|ios::badbit;
  27.             }
  28.         else
  29.             {
  30.             c = (char)tchar;
  31.             }
  32.         isfx();
  33.         }
  34.     return *this;
  35. }
  36.