?? people.cpp
字號:
// People.cpp: implementation of the People class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "People.h"
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
People::People()
{
}
// 拷貝構造函數
People::People(const People& p)
{
name=p.name;
id=p.id;
number=p.number;
sex=p.sex;
birthday=p.birthday;
}
People::~People()
{
}
/*
* 重載"=="運算符
* 判斷兩個People類對象的id屬性是否相等
*/
bool People::operator ==(People people)
{
return this->id == people.id ;
}
/*
* 重載"="運算符
* 實現People類對象的賦值操作
*/
People& People::operator =( People& people)
{
this->number = people.number;
this->id = people.id ;
this->sex = people.sex ;
this->name = people.name;
//birthday 賦值
this->birthday.year = people.birthday .year ;
this->birthday .month = people.birthday .month ;
this->birthday .day = people.birthday .day;
return *this;
}
// 設置人員信息
void People::setPeople(string setname,int setid,int setnumber,int setsex,Birthday setbirthday)
{
name=setname;
id=setid;
number=setnumber;
sex=setsex;
birthday=setbirthday;
}
void People::setPeople(string setname,int setid,int setnumber,int setsex,int setyear,int setmonth,int setday)
{
name=setname;
id=setid;
number=setnumber;
sex=setsex;
birthday.setBirth(setyear, setmonth, setday);
}
// 顯示人員信息
void People::displayPeople(string setname,int setid,int setnumber,int setsex,int setyear,int setmonth,int setday) const
{
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -