.\" ident @(#)wcerr.3 .\" Standard Template Library .\" $$RW_INSERT_HEADER "slyrs.man" .TH wcerr 3C++ "02 Apr 1998" "Rogue Wave Software" "-" .ce2 Standard C++ Library Copyright 1998, Rogue Wave Software, Inc. .SH NAME \f2wcerr\fP \ - Controls output to an unbuffered stream buffer associated with the object \f2stderr\fP declared in \f2\fP. .SH SYNOPSIS .br #include .br extern wostream wcerr; .br wostream wcerr; .SH DESCRIPTION The object \f2wcerr\fP controls output to an unbuffered stream buffer associated with the object \f2stderr\fP declared in \f2\fP. By default the standard C and C++ streams are synchronized, but you can improve performance by using the \f2ios_base\fP member function \f2synch_with_stdio\fP to desynchronize them. \f2wcerr\fP uses the locale \f2codecvt\fP facet to convert the wide characters it receives to the tiny characters it outputs to \f2stderr\fP. .SH FORMATTING The formatting is done through member functions or manipulators. See \f2cout\fP, \f2wcout\fP, or \f2basic_ostream\fP for details. .SH EXAMPLE .br // .br // wcerr example .br // .br #include .br #include .br .br void main ( ) .br { .RE .RS 1 using namespace std; .RE .RS 3 .RE .RS 2 // open the file "file_name.txt" .br // for reading .RE .RS 1 wifstream in("file_name.txt"); .RE .RS 2 .br // output the all file to stdout .RE .RS 1 if ( in ) .RE .RS 3 wcout << in.rdbuf(); .RE .RS 1 else .RE .RS 4 // if the wifstream object is in a bad state .br // output an error message to stderr .RE .RS 3 wcerr << L"Error while opening the file" << endl; .RE .RS 0 } .SH SEE ALSO basic_ostream(3C++), basic_iostream(3C++), basic_filebuf(3C++), cout(3C++), cin(3C++), cerr(3C++), clog(3C++), wcin(3C++), wcout(3C++), wclog(3C++), iomanip(3C++), ios_base(3C++), basic_ios(3C++) Working Paper for Draft Proposed International Standard for Information Systems--Programming Language C++, Section 27.3.2 .SH STANDARDS CONFORMANCE ANSI X3J16/ISO WG21 Joint C++ Committee