I don't understand why you are bothering with all these conversions. Most of them are wrong and make no sense in light of what you're trying to achieve. But more importantly, the data as it sits in memory is already in the form you want it in. If you receive an IEEE float value, it's ALREADY in floating point format, and all you have to do is print it out, no conversions necessary, although you may have to jigger pointer types to ensure that it is interpreted by the streams operators correctly. But trying to hammer it into a hex value, then into an int value and finally into a float value is pointless; all you're doing is messing up data that was perfectly good to begin with.
The only issue that might arise is receiving data over a network with a machine whose endianess differs from network byte order. This sort of problem is unlikely - I would think the socket layer would take care of such things without your intervention - but if simply treating your value as a float directly doesn't work, try byte-swapping it and outputting those results.
Right now, you're making the problem way too hard. In fact, you're assuming there's a problem where there really isn't one.
Bookmarks