[英]What is the difference between std::cout and std::wcout?
In c++ what is the difference between std::cout
and std::wcout
? 在c ++中,
std::cout
和std::wcout
什么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 type std::cout
使用char
作为字符类型 std::wcout
uses wchar_t
as character type std::wcout
使用wchar_t
作为字符类型 Otherwise 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::ios_base::Init
的对象期间或之前初始化这些对象。
std::cout
is std::basic_ios::tie
'd to std::cin
and to std::cerr
std::cout
是std::basic_ios::tie
到std::cin
和std::cerr
std:wcout
is std::basic_ios::tie
'd to std::wcin
and to std::wcerr
std:wcout
是std::basic_ios::tie
std::wcin
到std::wcin
和std::wcerr
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.