【发布时间】:2019-11-22 17:32:22
【问题描述】:
我尝试将多字符文字转换为 char 数组。
我知道 static_cast 以及如何计算多字符
但是多字符文字的结果如何插入到数组中。
跟随代码。
#include <iostream>
using namespace std;
int main()
{
char a [] ={static_cast<char>('adcde')};
cout << 'adcde' << endl;
cout << a << endl;
cout << a[3] << endl;
}
输出:
1684235365
e\270\365\277\357\376
\277
【问题讨论】:
标签: c++ char hex static-cast