#include #include //for setfill and setw #include using namespace std; int main() { double d = 1.0; unsigned char c = *reinterpret_cast(&d); cout << "The first byte of the double is 0x" << hex << setfill('0') << setw(2) << static_cast(c) << ".\n"; return EXIT_SUCCESS; }