hex stores into a variable ?

May 25, 2016 at 2:52pm
How do i store hex value in a variable ?

Like this ;

1
2
3
4
5

int show = 1; 

int hex = 0x2; // something like that ! 
May 25, 2016 at 2:57pm
Yes, that looks ok.
May 25, 2016 at 3:29pm
But it does not show 0C when i try to Print out using std::cout.

Thanks
May 25, 2016 at 3:34pm
1
2
3
#include <iomanip>
// ...
std::cout << std::hex << hex;
Last edited on May 25, 2016 at 3:34pm
Topic archived. No new replies allowed.