42f Subj : Re: Any help on why? To : borland.public.cpp.borlandcpp From : Bob Gonder Date : Wed Jul 07 2004 11:23 am Thomas Maeder [TeamB] wrote: >X and lX are for integral values. Using them for something else is an even >uglier hack than using the *printf() machinery at all. And you call the below code *Not* ugly? >To peek at the internals of, say, a double, the portable way is to >treat it as an array of unsigned char, as in > >double d(3.11415); >unsigned char const *const begin(reinterpret_cast(&d)); >unsigned char const *const end(begin + sizeof d); >for (unsigned char const *c = begin; c!=end; ++c) > printf("%u ",static_cast(*c)); Yeah, but you want to use hex. You can't see the bits in 123. My BC++ doesn't support 'reinterpret_cast' That's some new-age mumbo jumbo designed to slow down programmers. I suppose it's so hard to type that it encourages programmers to do *anything* (even use the correct types!) to avoid it. Not to mention, the OP's code was C not C++ to begin with. . 0