acidzombie24 acidzombie24 - 5 months ago 61
C++ Question

c++ cout hex values?

I want to do:

int a = 255;
cout << a;

and have it show FF in the output, how would i do this?



#include <iomanip>


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.