What is the difference between std::cout and std::wcout?

帅比萌擦擦* 提交于 2019-12-02 23:24:46

They operate on different character types:

  • std::cout uses char as character type
  • std::wcout uses wchar_t as character type

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::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
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!