关于C++中字符库的问题,如何解决(将int转换成wchar)
wchar = 173这时查看wchar有值为L'-',
将该值复制粘贴在空白处的结果为L'’,值不见了怎么回事??!!!!求大神指点下!!程序最后输出也没获得wchar的值。。网上百度什么宽字节,unicode啥啥的。。试了感觉不是啊
2015-03-26 19:47
2015-03-26 20:43
2015-03-26 21:05
2015-03-26 21:13
程序代码:#include <iostream>
int main( void )
{
std::wcout.imbue( std::locale("chs",std::locale::ctype) ); // 设置wcout的locale
// std::locale::global( std::locale("chs",std::locale::ctype) ); 或者使用这一句,设置全局的locale
wchar_t c = 173;
std::wcout << c << std::endl;
return 0;
}
2015-03-27 08:51


路过学习
2015-03-27 09:44
2015-03-27 21:01