void f(double *f){ *f+=1;}int main(){ int a=1; f((double *)&a); printf("%d ",a);}
2 回答
asd8532
TA贡献143条经验 获得超187个赞
#include <stdio.h> int f(double *f){ //printf("%f \n",*f);这里是0 //*f+=1; //printf("%f \n",*f);这里是1 //printf("%d \n",*f);这里是1 //*f+=1; //printf("%d \n",*f);这里是0 *f+=1; return (int)*f; } int main() { int a=1; a = f((double *)&a); printf("%d ",a); return 0; }
- 2 回答
- 0 关注
- 1381 浏览
添加回答
举报
0/150
提交
取消