📄 people.h
字号:
//文件people.h
#ifndef PEOPLE_H
#define PEOPLE_H
#include"Date.h"
#include "iostream.h"
#include "string.h"
class people
{private:
char*name;//姓名
int number;//编号
char*id;//身份证号码
char sex;//性别(男M,女W)
Date birthday;// 生日 子对象
static int psum;//静态变量,用来对整个系统成员个数的统计
public:
people(); //无参构造函数
people(char*,int,char*,char,int,int,int);//有参构造函数
people(const people &init);//拷贝构造函数
virtual ~people(){delete[]name;delete[]id;} //虚析构函数
inline void print();//内联函数
inline void input();
int getnum() //返回编号
{return number;}
char*getname()//返回姓名
{return name;}
char*getID() //返回身份证号码
{return id;}
friend void search(people p[],int num,int n); //查找函数
friend void sort(people p[],int n=4); //排序函数
friend int operator==(people a,people b);
people &operator=(const people &peo);//重载赋值运算符
static int getpsum(){return psum;} //静态公有函数:返回people类的总人数
void set(char*,int,char*,char,int,int,int);
char &operator[](int k);//下标重载运算符
};
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -