Question: I am doing some microcontroller programming in C. I am reading from various sensors 4 bytes that represent either `float`, `int` or `unsigned int`. Currently, I am storing them in `unsigned int` format in the microcontroller even though the data may be `float` since to a microcontroller they are just bytes. This data is then transferred to PC. I want the PC to interpret the *binary data* as a `float` or an `int` or an `unsigned int` whenever I wish. Is there a way to do that? 

Ex.

```
unsigned int value = 0x40040000; // This is 2.0625 in double
double result = convert_binary_to_double(value); // result = 2.0625

```

Thanks.

PS: I tried typecasting and that does not work.

Answer: 
Why don't you do something like:
`double *x = &value;`
or a union?
Have you tried using the [itoa()](http://en.wikipedia.org/wiki/Itoa) function? It's a neat little function often used for converting int to ASCII.