20 lines
346 B
C
20 lines
346 B
C
// https://rextester.com/l/c_online_compiler_gcc
|
|
|
|
#include <stdio.h>
|
|
|
|
int main(void)
|
|
{
|
|
unsigned char *fc = malloc(4 * sizeof(fc));
|
|
*((float*)fc) = 31.19;
|
|
|
|
fc[3] = 0b00111110;
|
|
fc[2] = 0b00100000;
|
|
fc[1] = 0b01000000;
|
|
fc[0] = 0b00000000;
|
|
|
|
printf("%f", *((float*)fc));
|
|
|
|
free(fc);
|
|
|
|
return 0;
|
|
} |