摘要: 1. 友元类#include using namespace std;class TV {public: friend class Tele; //这样Tele 就可以访问TV类了 TV():on_off(off),volume(20),channel(3),mod... 阅读全文
posted @ 2014-06-23 12:42 击进的Cocos 阅读(175) 评论(0) 推荐(0) 编辑
摘要: 1. 代码重用 体现于头文件。也就是面向对象的体现之一,还有多态性,稳定性等。2. 包含 1 //简单的包含的程序代码如下: 2 #include 3 using namespace std; 4 class A 5 { 6 public: 7 A(){x=0;} 8 A(int... 阅读全文
posted @ 2014-06-23 11:13 击进的Cocos 阅读(157) 评论(0) 推荐(0) 编辑