cplusplus.com cplusplus.com
cplusplus.com   C++ : Reference : IOstream Library : ios_base : sync_with_stdio
- -
C++
Information
Documentation
Reference
Articles
Sourcecode
Forum
Reference
C Library
IOstream Library
Strings library
STL Containers
STL Algorithms
IOstream Library
manipulators
classes:
· filebuf
· fstream
· ifstream
· ios
· iostream
· ios_base
· istream
· istringstream
· ofstream
· ostream
· ostringstream
· streambuf
· stringbuf
· stringstream
objects:
· cerr
· cin
· clog
· cout
types:
· fpos
· streamoff
· streampos
· streamsize
ios_base
· ios_base::ios_base
· ios_base::~ios_base
member classes:
· ios_base::failure
· ios_base::Init
member functions:
· ios_base::flags
· ios_base::getloc
· ios_base::imbue
· ios_base::iword
· ios_base::precision
· ios_base::pword
· ios_base::register_call...
· ios_base::setf
· ios_base::sync_with_stdio
· ios_base::unsetf
· ios_base::width
· ios_base::xalloc
member types:
· ios_base::event
· ios_base::event_callback
· ios_base::fmtflags
· ios_base::iostate
· ios_base::openmode
· ios_base::seekdir

-

ios_base::sync_with_stdio public static member function
bool sync_with_stdio ( bool sync = true );

Activate/deactivate synchronization of iostream and cstdio streams [static]

Toggles on or off synchronization of the iostream standard streams with the standard C streams.

When syncronization is on, the iostream standard stream objects (cin, cout, cerr, clog, and their wide versions wcin, wcout, wcerr and wclog) are synchronized with their C standard counterparts: stdin, stdout and stderr.

With stdio synchronization turned off, iostream standard stream objects may operate independently of the standard C streams.

By default, the standard iostream and cstdio streams are synchronized.

Notice that this is a static member function, therefore a call to this function using the member of any object (or of any related class) toggles on or off synchronization for all standard iostream objects.

Parameters

sync
Boolean parameter indicating whether synchronization is to be turned on or off: With a value of true it turns synchronization on, while a value of false turns it off.

Return Value

Returns the synchronization state that was set before the call.

© The C++ Resources Network, 2000-2007 - All rights reserved
Spotted an error? - contact us