Actually compiling C++ under Visual 2013, the behaviour of std::hex
(sticky operator) is not what I expected :
I'm trying to print a char as its hexadecial value, but I am forced to mask or cast my value to get the wanted behaviour.
So my question is not how to do, but why.
char valueInChar = 0xc8; //decimal 200
std::cout << std::hex << valueInChar; //prints out ╚
std::cout << std::hex << (valueInChar & 0xFF); //prints out c8
std::cout << std::hex << int(valueInChar); //also prints out c8
Is it a bug in visual implementation of the std? Am I confusing with std::ios::hex
?