I\'m looking for a way to convert hex(hexadecimal) to dec(decimal) easily. I found an easy way to do this like :
hex
dec
#include <iostream> #include <iomanip> #include <sstream> int main() { int x, y; std::stringstream stream; std::cin >> x; stream << x; stream >> std::hex >> y; std::cout << y; return 0; }