Converting hex to dec C++ -
convert hex:
cout << hex << int(x) << endl;
how convert conversely, hex dec?
enter hex number simple:
cin >> hex >> x;
you can use std::dec
io manipulator:
std::cout << std::dec << int(x) << endl;
note necessary if have used std::hex
or other means manipulate base of std::cout
. otherwise need take no action: default int
decimal.
Comments
Post a Comment