问题
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 ?
回答1:
They operate on different character types:
std::cout
useschar
as character typestd::wcout
useswchar_t
as character type
Otherwise both streams write to standard output.
回答2:
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
isstd::basic_ios::tie
'd tostd::cin
and tostd::cerr
std:wcout
isstd::basic_ios::tie
'd tostd::wcin
and tostd::wcerr
来源:https://stackoverflow.com/questions/32338496/what-is-the-difference-between-stdcout-and-stdwcout