源程序: #include <iostream>using namespace std; class vehicle{public: int wheels; float weight;public: vehicle(int wheels1, float weight1) { wheels = whe ...
分类:
其他好文 时间:
2020-02-04 20:10:34
阅读次数:
60
源程序: //封闭类的构造函数#include<iostream>#include<string>using namespace std; class myDate{public: myDate(); myDate(int); myDate(int, int); myDate(int, int, i ...
分类:
其他好文 时间:
2020-02-04 18:52:43
阅读次数:
73
源程序: #include<iostream>using namespace std; class CBase{public: CBase() {} CBase(CBase &c) { cout << "CBase::复制构造函数" << endl; } CBase & operator=(cons ...
分类:
其他好文 时间:
2020-02-04 18:44:53
阅读次数:
78
源程序: #include<iostream>using namespace std; class BaseClass1{protected: int v1, v2;public: BaseClass1(); BaseClass1(int, int); ~BaseClass1(); void Set ...
分类:
其他好文 时间:
2020-02-04 18:37:40
阅读次数:
70
源程序: #include<iostream>using namespace std; class another;class Base{private: float x;public: void print(const another &K);};class Derived:public Base ...
分类:
其他好文 时间:
2020-02-04 15:43:59
阅读次数:
79
源程序: //基类与子类占用空间及字节对齐#include<iostream>using namespace std; class BaseClass{ int v1,v2; char v4;public: int temp1(){}}; class DerivedClass:public Base ...
分类:
其他好文 时间:
2020-02-04 15:30:30
阅读次数:
69
源程序: #include <iostream>#include<string>using namespace std; class myComplex{private: double real, imag;public: myComplex(); myComplex(double r, doubl ...
分类:
其他好文 时间:
2020-02-04 14:11:12
阅读次数:
68
源程序: #include<iostream>using namespace std; class CDemo{private: int n;public: CDemo(int i=0):n(i){} CDemo & operator++(); //用于前置形式 CDemo operator++(i ...
分类:
其他好文 时间:
2020-02-04 14:10:56
阅读次数:
61
源程序: #include<iostream>#include<string>#include<cstdlib>using namespace std; class myComplex{private: double real,imag;public: myComplex():real(0),ima ...
分类:
其他好文 时间:
2020-02-04 14:10:28
阅读次数:
73
源程序: #include<iostream>using namespace std; class myComplex{ double real,imag;public: myComplex(double r=0,double i=0):real(r),imag(i){}; operator dou ...
分类:
其他好文 时间:
2020-02-04 14:09:33
阅读次数:
64