Rogue Wave banner
Previous fileTop of DocumentContentsNext file

14.4 Implicit Synchronization by Tying Streams

Another mechanism for automatic synchronization in certain cases is tying a stream to an output stream, as demonstrated in the code below. All input or output operations flush the tied stream's buffer before they perform the actual operation.

//1The input stream istr is tied to the output stream ostr. The tie() function returns a pointer to the previously tied output stream, or zero if no output stream is tied.
//2Before any input is done, the tied output stream's buffer is flushed so that the result of previous output operations to ostr is available in the external file /tmp/fil.
//3The previous tie is restored.

Previous fileTop of DocumentContentsNext file

©Copyright 1998, Rogue Wave Software, Inc.
Send mail to report errors or comment on the documentation.


OEM Release, June 1998