标准里面是这样解释的: Wide character 宽字节字符 Type whose range of values can represent distinct codes for all members of the largest extended character set specified among the supported locales. In C++, wchar_t is a distinct fundamental type (and thus it is not defined in <cwchar> nor any other header). 在C++中,它是一个特有的基本类型(因此它并没有在<cwchar>或其他header中被定义) 在C中,这是一个整数类型的typedef wchar_t 是C/C++的字符类型,一种扩展的存储方式,主要用在国际化程序的实现中。 char是8位字符类型,最多能包含256种字符,许多的外文字符集所包含的字符数目超过256个,char型不能表示。 比如对于汉字,韩文以及日文这样的字符,它们的每一个文字都占据两个字节,所以C++提出了wchar_t类型,也称为双字节类型,或宽字符类型。
|
|
来自: jackeyqing > 《学习整理360doc》