- 博客(9)
- 收藏
- 关注
原创 工资类(改)
#include using namespace std; class Salary { public: Salary(int n); Salary(const Salary &s); ~Salary(); void input_salary(); void show_salary()
2016-05-31 19:51:09 636
原创 深复制体验
#include#includeusing namespace std;class A{private: char *a;public: A(char *aa) { a = new char[strlen(aa)+1]; strcpy(a, aa); } ~A()
2016-05-31 19:49:00 530
原创 动态数组类
#includeusing namespace std;class MyArray{private: int *arrayAddr; //保存一个有len个整型元素的数组的首地址 int len; //记录动态数组的长度 int max; //动态数组中的最大值(并非动态数组中必须要的数据成员)public:
2016-05-31 19:48:15 888
原创 集成与派生——职员有薪水了
#include#includeusing namespace std;class CPerson{protected: string m_szName; string m_szId; int m_nSex;//0:women,1:man int m_nAge;public: CPerson(string name,stri
2016-05-25 18:44:01 455
原创 集成与派生——统计班长信息
*/#include#includeusing namespace std;class Stu //声明基类{public: Stu(int n, string nam ):num(n),name(nam){} void display( ) { cout }protected: //(*)
2016-05-25 18:22:59 543
原创 String类的构造
#include #include using namespace std; class String { public: String( ); String(const char *s); String(String &str);
2016-05-18 15:37:37 327
原创 数组类运算的实现
#include #include #include using namespace std;class Array{private: int* list; int size; public: Array(int sz = 50); Array(int a[], int sz);
2016-05-18 15:34:11 263
原创 time类
#include using namespace std;class CTime{private: unsigned short int hour; // 时 unsigned short int minute; // 分 unsigned short int second; // 秒public: CTime(int h=0,
2016-05-18 15:25:29 291
原创 实现复数类中的运算符重载
#include using namespace std; class Complex { public: Complex(){real=0;imag=0;} Complex(double r,double i){real=r; imag=i;} Complex operator+(const Complex &c2);
2016-05-18 15:22:43 304
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人