Integer to hex string in C++
Use <iomanip>‘s std::hex. If you print, just send it to std::cout, if not, then use std::stringstream You can prepend the first << with << “0x” or whatever you like if you wish. Other manips of interest are std::oct (octal) and std::dec (back to decimal). One problem you may encounter is the fact that this produces … Read more