Suppose I do a
double d = 234.5;
I want to see the memory contents of d [the whole 8 bytes]
d
How do I do that?
Try
union Plop { double value; char data[sizeof(double)]; }; Plop print; print.value = 234.5; std::copy(print.data,print.data+sizeof(double),std::ostream_iterator(std::cout)," "); std::cout << std::endl;