Converting hex to dec C++

℡╲_俬逩灬. 提交于 2019-12-02 09:30:48

You can use the std::dec IO manipulator:

std::cout << std::dec << int(x) << endl;

Note that this is only necessary if you have previously used std::hex or other means to manipulate the base of std::cout. Otherwise you need take no action: the default for an int is decimal.

Don't use the std::hex manipulator?

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