fork download
  1. #include <iostream>
  2.  
  3. template<class T>
  4. void hex_print(T const& t)
  5. {
  6. std::cout << __PRETTY_FUNCTION__ << '\n';
  7. std::cout << std::hex << t << '\n';
  8. }
  9.  
  10. int main()
  11. {
  12. char word[] = "a";
  13. hex_print(word[0] & 255);
  14. hex_print(static_cast<unsigned char>(word[0]));
  15. }
Success #stdin #stdout 0s 3096KB
stdin
Standard input is empty
stdout
void hex_print(const T&) [with T = int]
61
void hex_print(const T&) [with T = unsigned char]
a