摘要:
源程序: #include<iostream>#include<string>using namespace std; class Base{ //基类的3种访问控制类型成员变量public: int vBPub;protected: int vBPro;private: int vBPri;pub 阅读全文
posted @ 2020-02-04 16:23
bobo哥
阅读(123)
评论(0)
推荐(0)
摘要:
源程序: #include<iostream>using namespace std; class BaseClass1{public: int v1, v2; BaseClass1(); BaseClass1(int, int); ~BaseClass1();};BaseClass1::BaseC 阅读全文
posted @ 2020-02-04 16:21
bobo哥
阅读(109)
评论(0)
推荐(0)
摘要:
源程序: #include<iostream>using namespace std; class CB1{public: int a; //重名 CB1(int x) { a=x; } void showa() //重名 { cout<<"Class CB1==>a="<<a<<endl; }}; 阅读全文
posted @ 2020-02-04 16:19
bobo哥
阅读(93)
评论(0)
推荐(0)
摘要:
源程序: #include<iostream>using namespace std; class BaseClass //基类{protected: int v1, v2;public: void SetValue(int m, int n) { v1 = m; v2 = n; } void Pr 阅读全文
posted @ 2020-02-04 16:17
bobo哥
阅读(113)
评论(0)
推荐(0)
摘要:
源程序: #include<iostream>using namespace std; class BaseClass //基类{ int v1, v2;public: void SetValue(int m, int n) { v1 = m; v2 = n; } void PrintValue() 阅读全文
posted @ 2020-02-04 16:13
bobo哥
阅读(122)
评论(0)
推荐(0)
摘要:
源程序: #include<iostream>#include<string>using namespace std; class employee //类employee将作为其他几个类的基类{ short age; float salary;protected: string name;publ 阅读全文
posted @ 2020-02-04 16:11
bobo哥
阅读(186)
评论(0)
推荐(0)
摘要:
源程序: #include<iostream>#include<string>using namespace std; class CStudent //基类{private: string name; //姓名 string id; //学号 char gender; //性别,‘F’代表女生,‘ 阅读全文
posted @ 2020-02-04 16:01
bobo哥
阅读(173)
评论(0)
推荐(0)
摘要:
源程序: #include<iostream>using namespace std; class CB{public: int a; CB(int x) { a=x; } void showa() { cout<<"Class CB --a="<<a<<endl; }}; class CD:pub 阅读全文
posted @ 2020-02-04 15:59
bobo哥
阅读(203)
评论(0)
推荐(0)
摘要:
源程序: #include<iostream>using namespace std; class Base //基类{private: float x;public: static int staV; Base() { staV++; }}; int Base::staV = 0; class D 阅读全文
posted @ 2020-02-04 15:57
bobo哥
阅读(118)
评论(0)
推荐(0)
摘要:
源程序: #include<iostream>using namespace std; class another;class Base{private: float x;public: void print(const another &K);};class Derived:public Base 阅读全文
posted @ 2020-02-04 14:43
bobo哥
阅读(118)
评论(0)
推荐(0)

浙公网安备 33010602011771号