If I am understanding your intent correctly, you are misunderstanding type casts and what they do. Your variable f contains a binary representation of a floating point number. You are then casting the address of that variable from float * to char *. This does nothing whatsoever to the contents of f. You now have a pointer that you have demanded that the compiler consider a pointer to char that points to nothing of the sort.
Evidently, what you want is a character representation of the value in f. You have no such thing in your code at present. Neither a C or a C++ cast operator is relevant to creating such a thing.
If I am misunderstanding what you are trying to do, please clarify your question.
There are a number of things around that can be used to do this. Some posibilites that you might look at:
CString::Format()[
^],
sprintf()[
^],
boost::lexical_cast[
^], and std::ostringstream which can be used similarly to std::cout. An article that discusses these is
here[
^].
Most of these work with chars and not unsigned chars, so you may need a cast from char * to unsigned char *. Also what CString will give you is a const char *.
Note: I have been assuming here that you are not using a unicode build and do not have to worry about conversions to/from a unicode encoding.