The output of the below code is 0.0000
. What is happening in the code and why the output is 0.0000
or to ask precisely what happens when we type cast the int*
to float*
and print the de-referenced value in the below code?
int main(){
int i = 10;
int *p = &i;
printf("%f\n", *(float*)p);
return 0;
}