In c++ what is the difference between std::cout
and std::wcout
?
They both control output to a stream buffer or print stuff to the console, or are they just alike ?
In c++ what is the difference between std::cout
and std::wcout
?
They both control output to a stream buffer or print stuff to the console, or are they just alike ?
They operate on different character types:
std::cout
uses char
as character typestd::wcout
uses wchar_t
as character typeOtherwise both streams write to standard output.
Another thing is that both are used with respected input stream.
Objects of these are initialized during or before the first time an object of std::ios_base::Init
is created.
std::cout
is std::basic_ios::tie
'd to std::cin
and to std::cerr
std:wcout
is std::basic_ios::tie
'd to std::wcin
and to std::wcerr