宽字符输出结果 [英] Wide character output result

查看:129
本文介绍了宽字符输出结果的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为什么在使用wchar_t时获取数字作为输出结果?

Why do I get numbers as output result when using wchar_t?

#include <iostream>
using namespace std;
int main()
{
    wchar_t q;
    q = 'A';
    cout << q;
    q = 'B';
    cout << q;
    q = 'C';
    cout << q;
    return 0;
}


推荐答案

字符的。这就是你得到'数字'的原因。如果您要显示字符,可以使用 wcout

The displayed 'numbers' are the value of the character. That's the reason you get 'numbers'. If you want to display the characters you can use wcout

这篇关于宽字符输出结果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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