Rogue Wave banner
Previous fileTop of DocumentContentsIndex pageNext file
Rogue Wave C++ Standard Library Reference Guide
Rogue Wave web site:  Home Page  |  Main Documentation Page

wcin

Module:  Standard C++ Library   Library:  Input/output

Local Index

No Entries

Summary

A predefined stream that controls input from a stream buffer associated with the object stdin declared in <cstdio>

Synopsis

#include <iostream>

namespace std {
  extern wistream wcin;
}

Description

The object wcin controls input from a stream buffer associated with the object stdin declared in <cstdio>. By default the standard C and C++ streams are synchronized, but performance improvement can be achieved by using the ios_base member function synch_with_stdio to desynchronize them.

After the object wcin is initialized, wcin.tie() returns &wcout, which implies that wcin and wcout are synchronized. wcin uses the locale codecvt facet to convert the tiny characters extracted from stdin to the wide characters stored in the wcin buffer.

Warnings

Keep in mind that while the manipulator endl flushes the stream buffer, outputting the character L'\n' is not guaranteed to flush the stream buffer. You should output the L'\n' character without endl only if you do not need the buffer flushed. Note that outputting the L'\n' character in such cases, and hence not forcing a buffer flush, may result in a performance improvement. It greatly improves performance when C and C++ streams are not synchronized.

See Also

basic_istream, basic_iostream, basic_filebuf, cin, cout, cerr, clog, wcout, wcerr, wclog, ios_base, basic_ios

Standards Conformance

ISO/IEC 14882:1998 -- International Standard for Information Systems --Programming Language C++, Section 27.3.2



Previous fileTop of DocumentContentsIndex pageNext file

Copyright (c) 1994-2006 Rogue Wave Software, a Quovadx Division.
Licensed under the Apache License, Version 2.0.
Contact Rogue Wave about documentation or support issues. You can also seek help from other developers through the Apache stdcxx community (see below).

For more information on the Rogue Wave Standard C++ Library under open source, see Section 1.2 of the user's guide.