02 2019 档案

摘要:#include<iostream> using namespace std; void foo() { int num = 4; for(int i = 0;i<10;i++) { /* static int snum = num; snum++; cout<<snum<<endl; */ sta 阅读全文
posted @ 2019-02-21 10:58 zengzhaocheng 阅读(771) 评论(0) 推荐(0)
摘要:#include <iostream> using namespace std; void foo() { static int count = 0; if(count<5) { count++; cout<<count<<endl; foo(); } else { cout<<"count > 5 阅读全文
posted @ 2019-02-21 10:28 zengzhaocheng 阅读(971) 评论(0) 推荐(0)
摘要:不像普通的变量,静态成员变量是被所有类对象共享的,不同的对象可以访问对方的该静态成员变量,因此静态成员变量和类对象并没有联系。 The static keyword has another meaning when applied to global variables -- it gives th 阅读全文
posted @ 2019-02-20 16:49 zengzhaocheng 阅读(1380) 评论(0) 推荐(0)
摘要:该条款第二自然段写道,定义的记号名称ASPECT_RATIO 1.653可能从未被编译器看见。 #define ASPECT_RATIO 1.653 这里的定义,在什么情况下会不被编译器看到? 前提当然是正常写,不用ifelse分支隔离某些define。 阅读全文
posted @ 2019-02-20 16:01 zengzhaocheng 阅读(222) 评论(1) 推荐(0)