|
[求助]请问如何判断i++与++i哪一个运行更快
在for循环 比如 for(i=0;i<10;i++) "()"里有三条表达式,对于楼主的问题,我们关注第三条"i++" 这是独立的一条语句,所以,无论i++或++i,i都会自加一, 看反汇编出来的代码: MOV EAX,DWORD PTR SS:[EBP-4] //eax=i ADD EAX,1 //eax<-eax+1 MOV DWORD PTR SS:[EBP-4],EAX //i=eax MOV ECX,DWORD PTR SS:[EBP-4] ADD ECX,1 //ps:这里和上面一样 MOV DWORD PTR SS:[EBP-4],ECX 一样的 |
|
|
|
[求助]请问如何判断i++与++i哪一个运行更快
如果代码写成 i=1; k=1+(i++); 那么k=2; 如果是 k=1+(++i); 那么k=3 照这样看来,如果最后要看的是i的值,那么在一条表达式内,变化得比较快的应该是++i,因为会先自加一,再进行运算,i++则用i去运算,再自加一! |
|
[注意]看雪论坛学习交流小组第一期初选名单
就系这样,,喵`` |
|
[注意]看雪论坛学习交流小组第一期初选名单
楼上的还报名呀```` |
|
[注意]热心会员 报名(第一批热心会员名单确定)
哇,恭喜三位~~~~ |
|
|
|
|
|
[注意]『看雪论坛学习交流小组』第一期学习班报名结束,正在审核申请
请回贴前看75楼,风哥的话 |
|
[求助]Stolen Code是指什么?
````````````偷代码 |
|
|
|
[公告]『虚拟机技术』 版块成立,特聘Bughoho,linxer为『虚拟机技术』版主
老虎哥,``好吃么?` |
|
|
|
|
|
[求助]请教:有一个注册机,只能在win98下使用,能不能有什么办法能在xp下用该注册机呢?
不能运行,还是算号不对? |
操作理由
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 }}
勋章
兑换勋章
证书
证书查询 >
能力值