c++ print hex value of char code example Example: c++ printf char as hex printf("%02x", (unsigned char) c);