快捷搜索:   服务器  安全  linux 安全  MYSQL  dedecms

test {} and the "for" am

#include
    int true_or_false();

    int true_or_false()
    {
    static j = 0;
    j++;
    if(j == 20)
    return 0;
    else
    return 1;
    }

    int main(int argc, char* argv[])
    {
    {
    int i;
    i=1;
    cout << i << endl;
    }

    int i;
    i=2;
    cout << i << endl;

    {
    for(int i = 0; true_or_false(); i++)
    cout << i;
    }

    return 0;
    }


    1,在{}内声明的实例,在退出{}时会调用析构函数析构
    2,自己以前对判断条件的理解太片面了。

顶(0)
踩(0)

您可能还会对下面的文章感兴趣:

最新评论