|
一个C语言的简单问题!求助中!
4楼正解 为便于分析,将问题程序简化如下 #include <stdio.h> void main() { int a=1,b=1; float c=1.1; printf("%f %d %d\n",a,b,c); } 反汇编后 00401000 /$ 68 9999F13F push 3FF19999 00401005 |. 68 000000A0 push A0000000 0040100A |. 6A 01 push 1 0040100C |. 6A 01 push 1 0040100E |. 68 30904000 push 00409030 ; ASCII "%f %d %d",LF 00401013 |. E8 08000000 call 00401020 00401018 |. 83C4 14 add esp, 14 0040101B \. C3 retn 这里可以看到 不同于msdn的解释,float其实是作为64bit的double压栈的 因为长度和其他连个参数int不一致,所以显示结果当然会出问题 再看看输出结果 所以我猜测长度的不一致,导致了64位长的浮点数 被分成两个int输出,而两个1,被合并成一个64bit的浮点数输出了 3FF19999转十进制正好是1072798105 A0000000有符号十进制也正是-1610612736 问题应该在这里 |
|
|
|
[求助]0 day怎么读?
零日,我一般这么读,避免重英混杂 |
|
|
|
|
|
|
|
|
|
|
操作理由
RANk
{{ user_info.golds == '' ? 0 : user_info.golds }}
雪币
{{ experience }}
课程经验
{{ score }}
学习收益
{{study_duration_fmt}}
学习时长
基本信息
荣誉称号:
{{ honorary_title }}
能力排名:
No.{{ rank_num }}
等 级:
LV{{ rank_lv-100 }}
活跃值:
在线值:
浏览人数:{{ visits }}
最近活跃:{{ last_active_time }}
注册时间:{{ user_info.create_date_jsonfmt }}
勋章
兑换勋章
证书
证书查询 >
能力值