std :: cout和std :: wcout有什么区别? [英] What is the difference between std::cout and std::wcout?

查看:121
本文介绍了std :: cout和std :: wcout有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在c ++中, std :: cout std :: wcout 有什么区别?

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 使用 char 作为字符类型

  • std :: wcout 使用 wchar_t 作为字符类型

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

否则,两个流均写入标准输出。

Otherwise both streams write to standard output.

这篇关于std :: cout和std :: wcout有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆