C++使用cout输出中文,打印出来的全是问号
PHP中文网
PHP中文网 2017-04-17 13:43:54
0
2
1352

就只是很简单的代码,结果打印出来的是一排问号:????????。我改了下字符集,不管是unicode还是多字节,都不能正常显示,我用的是vs2015。

void main()
{
    cout << "输入字母" << endl;
}
PHP中文网
PHP中文网

认证0级讲师

reply all(2)
巴扎黑

It is estimated that the encoding format of your source file is different from the format of the Windows console. You can try outputting to a file and then opening the output file. There should be no garbled characters.

Peter_Zhu

The console under windows uses gbk encoding. Your output is unicode.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template