1 byte integer data type

浪子不回头ぞ 提交于 2019-12-04 07:50:49

Not that I know of.

You could do the I/O using a wider integer type, and use range checking and casting as appropriate.

I'm afraid I don't know of a way either, but reading a hex number into an integer type can be accomplished as follows:

#include <iostream>
using namespace std;

int main () {
    short c;
    cin >> std::hex >> c;
    cout << c << endl;
    return 0;
}
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!