std::cout << std::hex << (int)p[i];
std::cout << std::hex << static_cast<int>(p[i]);
void print_hex_val(T t, char const* name){  // GWC changed C cast to reinterpret_cast:  unsigned char const* p = reinterpret_cast<unsigned char const*>(&t);  std::cout << "hex value of " << name << " is: ";// GWC modifications begin  // My principal compiler, mingw gcc, has sizeof(long double) == 12,  // but only ten bytes are significant; the other two are padding.  std::size_t size_of_T = sizeof(T);#if defined __GNUC__ && defined _X86_  if(12 == size_of_T)    size_of_T = 10;#endif // defined __GNUC__ && defined _X86_// GWC modifications end  for (unsigned int i = 0; i < size_of_T; ++i) { // modified by GWC    if(p[i] <= 0xF)      std::cout << "0";    // GWC changed C cast to static_cast:    std::cout << std::hex << static_cast<int>(p[i]);  }// GWC modifications begin  std::cout << " / ";  for (int i = size_of_T - 1; 0 <= i; --i) {    if(p[i] <= 0xF)      std::cout << "0";    std::cout << std::hex << (int)p[i];  }  std::cout << std::dec << std::endl;// GWC modifications end}