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

  1. /*[]------------------------------------------------------------[]*/
  2. /*|                                                              |*/
  3. /*|     sttie.cpp                                                |*/
  4. /*|                                                              |*/
  5. /*|     Class ios                                                |*/
  6. /*|          ostream *ios::tie( ostream * )                      |*/
  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. ostream* ios::tie(ostream* s)
  22. {
  23.     ostream *x = x_tie;
  24.     // documentation doesn't state whether to flush old tied stream
  25.     if( x )
  26.         x->flush();
  27.     x_tie = s;
  28.     if( s )
  29.         {
  30.         ispecial |= tied;
  31.         ospecial |= tied;
  32.         }
  33.     else
  34.         {
  35.         ispecial &= ~tied;
  36.         ospecial &= ~tied;
  37.         }
  38.     return x;
  39. }
  40.  
  41.  
  42.