标题:VC++求助
只看楼主
heavenorhell
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2006-8-21
 问题点数:0 回复次数:0 
VC++求助

#include <iostream.h>

void main()
{
float f=34.5;
float* fPtr=&f; //浮点指针

int* iPtr=(int*)&f; //warning: 将浮点变量的地址赋给整型指针

cout <<f <<endl
<<"iPtr:" << iPtr <<"=>" <<*iPtr <<endl
<<"fPtr:" << fPtr <<"=>" <<*fPtr <<endl <<endl;


}
//为什么*fptr的结果是1107951616。这个浮点值和34.5的关系是什么?

搜索更多相关主题的帖子: endl fPtr iPtr float int 
2006-08-21 22:12



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-85354-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 1.189262 second(s), 7 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved