Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Zortech C++ 3.0r4 - <b>ios::tie</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
ios::tie

Usage

   #include <iostream.hpp>
   ostream *ios::tie(ostream *stream_to_tie);
   ostream *tie() const;

Description

   Any stream can have a specified output stream (ostream) tied to it. This
   means that before any input or output operation on the stream, the stream
   that is tied to it is to be flushed, that is its output is to be brought
   completely up to date, with anything that has been buffered sent to its

   final destination.

   For example, the standard input and standard error streams have the
   standard output stream tied to them. This means that before any input is
   taken via cin, cout is flushed so that all previous output appears before
   waiting for input commences. The tie functions set or read the current
   tied ostream. By default stream objects have no ostream tied to them.
   Such tying must be done explicitly.

Example 

   ofstream outfile("somefile.dat");
       // an output file stream
   outfile.tie(&cout);
   outfile << "Something";
   cout << "Output to the file is flushed before this appears";

Return Value

   The const version returns a pointer to the currently tied ostream, zero

   if there is none. The non-const version returns the previous pointer.





Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson