上一页 1 ··· 23 24 25 26 27 28 29 30 31 ··· 54 下一页
摘要: 源程序: #include<iostream>using namespace std; class CBase{protected: int n;public: CBase(int i) :n(i) {} void Print() { cout << "CBase:n=" << n << endl; 阅读全文
posted @ 2020-02-04 18:31 bobo哥 阅读(202) 评论(0) 推荐(0)
摘要: 源程序: #include<iostream>using namespace std; class BaseClass1{protected: int v1, v2;public: BaseClass1(); BaseClass1(int, int); ~BaseClass1();}; BaseCl 阅读全文
posted @ 2020-02-04 18:28 bobo哥 阅读(119) 评论(0) 推荐(0)
摘要: 源程序: #include<iostream>#include<string>using namespace std; class B;class A{public: int aInt; B *bPoint = NULL; void SetValue(int v) { aInt = v; }}; c 阅读全文
posted @ 2020-02-04 18:23 bobo哥 阅读(156) 评论(0) 推荐(0)
摘要: 源程序: //封闭类的构造函数#include<iostream>#include<string>using namespace std; class myDate{public: myDate(); myDate(int); myDate(int, int); myDate(int, int, i 阅读全文
posted @ 2020-02-04 18:14 bobo哥 阅读(148) 评论(0) 推荐(0)
摘要: 源程序: #include<iostream>using namespace std; class BaseClass1{protected: int v1, v2;public: BaseClass1(); BaseClass1(int, int); ~BaseClass1(); void Set 阅读全文
posted @ 2020-02-04 17:58 bobo哥 阅读(117) 评论(0) 推荐(0)
摘要: 源程序: #include<iostream>using namespace std; class CBase{public: CBase() {} CBase(CBase &c) { cout << "CBase::复制构造函数" << endl; } CBase & operator=(cons 阅读全文
posted @ 2020-02-04 17:54 bobo哥 阅读(151) 评论(0) 推荐(0)
摘要: 源程序: #include<iostream>using namespace std; class A{public: A() //默认构造函数 { i = 100; cout << "类A默认构造函数" << endl; } A(const A&s) //复制构造函数 { i = s.i; cou 阅读全文
posted @ 2020-02-04 17:49 bobo哥 阅读(145) 评论(0) 推荐(0)
摘要: 源程序: #include<iostream>using namespace std; class Base{private: int Y;public: Base(int y=0) { Y=y; cout<<"Base("<<y<<")"<<endl; } ~Base() { cout<<"~Ba 阅读全文
posted @ 2020-02-04 17:29 bobo哥 阅读(144) 评论(0) 推荐(0)
摘要: 源程序: #include<iostream>using namespace std; class BaseClass{public: int v1, v2; BaseClass(); BaseClass(int, int); ~BaseClass();};BaseClass::BaseClass( 阅读全文
posted @ 2020-02-04 17:26 bobo哥 阅读(142) 评论(0) 推荐(0)
摘要: 源程序: #include<iostream>#include<string>using namespace std; class A{ int an;public: A() {} A(int n) { an = n; } void print() { cout << "A的对象:"; cout < 阅读全文
posted @ 2020-02-04 16:30 bobo哥 阅读(101) 评论(0) 推荐(0)
上一页 1 ··· 23 24 25 26 27 28 29 30 31 ··· 54 下一页