上一页 1 ··· 22 23 24 25 26 27 28 29 30 ··· 54 下一页
摘要: 源程序: #include <iostream>using namespace std; class Bas{public: ~Bas() { cout << "Bas析构函数" << endl; } virtual void f() = 0;}; class Dev :public Bas{pub 阅读全文
posted @ 2020-02-04 22:47 bobo哥 阅读(217) 评论(0) 推荐(0)
摘要: 源程序: #include <iostream>using namespace std; class A{public: int i; virtual void func() { cout << "A0" << endl; } virtual void func2() { cout << "A1" 阅读全文
posted @ 2020-02-04 21:48 bobo哥 阅读(153) 评论(0) 推荐(0)
摘要: 源程序: #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 21:30 bobo哥 阅读(213) 评论(0) 推荐(0)
摘要: 源程序: #include <iostream>using namespace std; class base{ int a;public: base(int sa) { a = sa; } int geta() { return a; }}; class derived :public base{ 阅读全文
posted @ 2020-02-04 21:15 bobo哥 阅读(192) 评论(0) 推荐(0)
摘要: 源程序: #include <iostream>using namespace std;class B{private: int data;public: B() { cout << "构造函数B" << endl; } B(int a) { data = a; cout << "带1个参数的构造函 阅读全文
posted @ 2020-02-04 21:06 bobo哥 阅读(128) 评论(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 20:25 bobo哥 阅读(145) 评论(0) 推荐(0)
摘要: 源程序: #include <iostream>#include <string>using namespace std;class Date{public: Date(int y, int m, int d) { SetDate(y,m,d); } void SetDate(int y, int 阅读全文
posted @ 2020-02-04 20:17 bobo哥 阅读(174) 评论(0) 推荐(0)
摘要: 源程序: #include <iostream>using namespace std; class Base{private: int radius, width;public: Base() { cout << "Base默认构造函数" << endl; } Base(int r, int w) 阅读全文
posted @ 2020-02-04 19:53 bobo哥 阅读(146) 评论(0) 推荐(0)
摘要: 源程序: #include <iostream>using namespace std; class vehicle{public: int wheels; float weight;public: vehicle(int wheels1, float weight1) { wheels = whe 阅读全文
posted @ 2020-02-04 19:37 bobo哥 阅读(163) 评论(0) 推荐(0)
摘要: 源程序: #include <iostream>using namespace std; class CB{ int b;public: CB(int n) { b = n; cout << "CB::b=" << b << endl; } ~CB() { cout << "CB的对象在消亡" << 阅读全文
posted @ 2020-02-04 18:51 bobo哥 阅读(141) 评论(0) 推荐(0)
上一页 1 ··· 22 23 24 25 26 27 28 29 30 ··· 54 下一页