Matt Broilo

float to char conversion

Discussion created by Matt Broilo on Aug 9, 2008
Latest reply on Aug 10, 2008 by Matt Broilo
I'm sure that this is a popular question:
How do you convert a 4 byte float into 4 chars?  I have tried type casting and doing funny stuff with pointers, but it appears that Code Warrior is saying "I know what you're trying to do, and I won't let you." (I either get an explicit or implicit change of data type error).  All I want is the raw float, in bits, in IEEE-754 format, broken into 4 bytes so that I can ship it out one byte at a time.  I haven't tried the sprintf deal yet, seems a bit impractical, but if that's what I have to do...

thanks in advance for any help here.

Outcomes