Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
800 B

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