标题:大家莱试试这两段代码,看看结果是什么,为什么呢?
取消只看楼主
hlhlf4
Rank: 1
等 级:新手上路
帖 子:7
专家分:2
注 册:2012-7-25
 问题点数:0 回复次数:1 
大家莱试试这两段代码,看看结果是什么,为什么呢?
程序代码:
    int i=3;
    int j=3;
    i = pow(++i,2);
    j = pow(j++,2);
    cout<<i<<endl;
    cout<<j<<endl;


程序代码:
    int i = 0;
    int j = 0;
    if (++i)
        i++;
    if (j++)
        j++;
    cout<<i<<endl;
    cout<<j<<endl;
搜索更多相关主题的帖子: 看看 
2012-10-08 22:14
hlhlf4
Rank: 1
等 级:新手上路
帖 子:7
专家分:2
注 册:2012-7-25
得分:0 
回复 4楼 zhang197771
不应该吗?
2012-10-10 02:32



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




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

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