cplusplus.com cplusplus.com
cplusplus.com   C++ : Reference : IOstream Library : ios_base : Init
- -
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::Init public member class
class Init;

Initialize standard stream objects

The construction of the member object Init ensures that the standard iostream objects (cin, cout, cerr, clog, and their wide counterparts wcin, wcout, wcerr, wclog) are constructed and initialized.

The class maintains an internal static counter (as a private member) with the number of existing objects.

class ios_base::Init {
public:
  Init();
  ~Init();
}

Members

Init(); (constructor)
Increases the internal static counter by one. If the value of the internal counter was zero, the standard iostream objects are constructed and initialized.
~Init(); (destructor)
Decreases the internal static counter by one. If the value of the internal counter reaches zero, the respective flush member functions of the output standard objects are called so that their buffers are flushed.

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