My program reads into 4 bytes an IEEE 754 floating point number from a file. I need to portable convert those bytes to my C compilers float type. In other words I need a fun
If the endianness is the same, then like so:
float f; memcpy(&f, raw_value, sizeof f); return f;
If not, say:
float f; char * p = (char *)&f;
And now populate the bytes p[0]... manually as needed.
p[0]