📄 people.h
字号:
#include<iostream>
#include<cstring>
using namespace std;
class data
{
public:
data(int y,int m,int d)
{
year=y;
month=m;
day=d;
cout<<"data's constructor called"<<endl;
}
data(){}
~data(){cout<<"data's destructor called"<<endl;}
void display()
{
cout<<year<<"年"<<month<<"月"<<day<<"日"<<endl;
}
private:
int year,month,day;
};
class people
{
public:
people(string n,string no,string s,data birth,string i):birthday(birth)
{
name=n;
number=no;
sex=s;
id=i;
cout<<"people's constructor called"<<endl;
}
people(){}
~people(){cout<<"people's destructor called"<<endl;}
void show();
protected:
data birthday;
string name,number,sex,id;
};
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -