Dan*_*obe 1 c pointers casting
C Noob在这里尝试跟随一些在线讲座.在教授的例子中,他向我们展示了我们可以通过执行以下操作将存储在int中的数据作为float读取*(float*)&i.我尝试使用以下代码执行此操作但没有任何反应.我在这里测试http://ideone.com/ExmXSW
#include <stdio.h>
int main(void) {
// your code goes here
int i=37;
printf("%f", *(float*)&i);
return 0;
}
Run Code Online (Sandbox Code Playgroud)