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

  1. /*[]------------------------------------------------------------[]*/
  2. /*|                                                              |*/
  3. /*|     isteush.cpp                                              |*/
  4. /*|                                                              |*/
  5. /*|     Class istream                                            |*/
  6. /*|          istream& istream::operator>> ( unsigned short& )    |*/
  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. /*
  19.     To reduce the total amount of code, shorts and ints are extracted into
  20.     a long, and the result stored in the proper type.  If long arithmetic
  21.     creates an unacceptable overhead, you can duplicate the code with
  22.     the obvious modifications for shorts or ints.
  23. */
  24.  
  25. #include <ioconfig.h>
  26. #include <iostream.h>
  27.  
  28. istream _FAR & istream::operator>> (unsigned short _FAR & i)
  29. {
  30.     unsigned long l;
  31.     *this >> l;
  32.     if( ! fail() )
  33.         i = (unsigned short) l;
  34.     return *this;
  35. }
  36.  
  37.  
  38.