03 2012 档案
摘要://Author: Yao H. Wang//转载请注明出处:http://www.cnblogs.com/yaohwang/archive/2012/03/04/2367987.html 测试代码如下: 1 #include "stdafx.h" 2 #include <iostream> 3 4 using namespace std; 5 6 class Base 7 { 8 public: 9 int pubi;10 void pub()11 {12 cout << "Base public" << endl;
阅读全文
摘要://Author: Yao H. Wang//转载请注明出处:http://www.cnblogs.com/yaohwang/archive/2012/03/03/2367983.html Const成员如其它任何成员一样,简单考虑其出现在三个位置:全局作用域、普通函数内部、类里面。下面请看测试代码: 1 #include "stdafx.h" 2 #include <iostream> 3 4 using namespace std; 5 6 class A 7 { 8 public: 9 const int j;10 //const int k = 3;11
阅读全文