📄 teacher.cpp
字号:
// Teacher.cpp: implementation of the Teacher class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "Teacher.h"
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
Teacher::Teacher(){}
Teacher::Teacher(string name,int number,int sex,int id,Birthday birthday)
{
this->name = name;
this->number = number;
this->sex = sex;
this->id = id;
this->birthday.year = birthday.year ;
this->birthday .month = birthday .month ;
this->birthday .day = birthday .day;
}
Teacher::~Teacher()
{
}
void Teacher::SetTeacherInfo(char department[], char principalship[])
{
for(int i = 0;i<21;i++)
this->principalship[i]= principalship[i];
for(int n = 0;n<11;n++)
this->department[n]= department[n];
}
Teacher Teacher::operator =( Teacher &teacher)
{
People::operator =(teacher);
//this->SetTeacherInfo(teacher.department,teacher.principalship );
for(int i = 0;i<21;i++)
this->principalship[i]= teacher.principalship[i];
for(int n = 0;n<11;n++)
this->department[n]= teacher.department[n];
return *this;
}
Teacher::Teacher(const Teacher &teacher){
this->name = teacher.name;
this->number = teacher.number;
this->sex = teacher.sex;
this->id = teacher.id;
this->birthday.year = teacher.birthday.year ;
this->birthday .month = teacher.birthday .month ;
this->birthday .day = teacher.birthday .day;
for(int i = 0;i<21;i++)
this->principalship[i]= teacher.principalship[i];
for(int n = 0;n<11;n++)
this->department[n]= teacher.department[n];
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -