
#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,自己以前对判断条件的理解太片面了。