conversion between float and unsigned char [4]

I’ve always done this one:

float f = something;
unsigned char *uc4 = (unsigned char*)&f;

You don’t need to go through an union for char or unsigned char, though you do for any other types.

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top