What is wrong with this int to float conversion in C?
c, floating-point, integer, type-conversion
Solution
Your program invokes undefined behaviour. You are simply reinterpreting the representation of the `float` as an `int`. You are categorically not converting an `int` to a `float`. You cannot expect any particular behaviour.
To convert the float into an int you would use code like this:
int b = a;
which truncates the `float` to an `int`.
Problem
I'm confused by the output of the following bit of code: ``` float a = 1.32; int* b; b= &a; printf("%d", *b); ``` This bit of code turns the float into an int, but the output I'm getting is: 1068037571 Is this related to the IEEE 754 converting capabilities of the computer? Thanks!