I want to do:
int a = 255; cout << a;
and have it show FF in the output, how would I do this?
Use:
#include <iostream> ... std::cout << std::hex << a;
There are many other options to control the exact formatting of the output number, such as leading zeros and upper/lower case.
2.1m questions
2.1m answers
60 comments
57.0k users