home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c082_122 / 9.ddi / IOSTRSR1.ZIP / ISTPBACK.CPP < prev    next >
Encoding:
C/C++ Source or Header  |  1992-06-10  |  1.0 KB  |  36 lines

  1. /*[]------------------------------------------------------------[]*/
  2. /*|                                                              |*/
  3. /*|     filename - istpback.cpp                                  |*/
  4. /*|                                                              |*/
  5. /*|     Class istream                                            |*/
  6. /*|          istream& istream::putback(char c)                   |*/
  7. /*|                                                              |*/
  8. /*[]------------------------------------------------------------[]*/
  9.  
  10. /*
  11.  *      C/C++ Run Time Library - Version 5.0
  12.  *
  13.  *      Copyright (c) 1990, 1992 by Borland International
  14.  *      All Rights Reserved.
  15.  *
  16.  */
  17.  
  18. #include <ioconfig.h>
  19. #include <iostream.h>
  20.  
  21. // push back char into input
  22.  
  23. istream _FAR & istream::putback(char c)
  24. {
  25.     if( ! fail() )
  26.         {
  27.         if( bp->sputbackc(c) == EOF )
  28.             setstate(ios::failbit);
  29.         else
  30.             clear(rdstate() & ~ios::eofbit);
  31.         }
  32.     return *this;
  33. }
  34.  
  35.  
  36.