std :: wstring VS std :: string

不羁的心 提交于 2020-08-04 22:16:26

问题:

I am not able to understand the differences between std::string and std::wstring . 我无法理解std::stringstd::wstring之间的区别。 I know wstring supports wide characters such as Unicode characters. 我知道wstring支持宽字符,例如Unicode字符。 I have got the following questions: 我有以下问题:

  1. When should I use std::wstring over std::string ? 什么时候应该在std::string使用std::wstring
  2. Can std::string hold the entire ASCII character set, including the special characters? std::string容纳整个ASCII字符集,包括特殊字符吗?
  3. Is std::wstring supported by all popular C++ compilers? 所有流行的C ++编译器都支持std::wstring吗?
  4. What is exactly a " wide character "? 什么是“ 宽字符 ”?

解决方案:

参考一: https://stackoom.com/question/1geR/std-wstring-VS-std-string
参考二: https://oldbug.net/q/1geR/std-wstring-VS-std-string
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!