iostream - STL C++

wcerr

Declaration

extern wostream wcerr;

Description

The wcerr object is an instantiation of the output stream wostream that controls the stream buffer and is used to output wide-character error messages.

Header Include

#include <iostream>

Example

#include <iostream>

int main() {
	using namespace std;

	// We can send any content to wcerr, just like wcout
	wcerr << L"XoaX.net" << endl;

	// However, we usually reserve wcerr for error messages
	wcerr << L"An error has occured" << endl;

	// Keep the window open
	cin.get();
	return 0;
}

Output

wcerr Output
 

© 2007–2024 XoaX.net LLC. All rights reserved.