⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 teacher.h

📁 用C++编写的教师学生相关信息和统计系统
💻 H
字号:
#include"common_people.h"
#ifndef teacher_h
#define teacher_h
class teacher:virtual public common_people
{ 
	friend class list;
public:
	char department2[30];
    char major2[30];
	char post1[30];
     teacher()
		{
			common_people();
            department2[0]=major2[0]=post1[0]='\0';		
		}
    teacher(char *name1,int num,char *sex1,char *birth,char *depart,char *major0,char*post0):common_people(name1,num,sex1,birth)
		{
		  
		  strcpy(department2,depart);
		  strcpy(major2,major0);
		  strcpy(post1,post0);
		}
	virtual void print();
	virtual void getnode();
	virtual void sav(char *nam);
};
//
void teacher::sav(char *nam)
{      
    ofstream out(nam,ios_base::app);
	out<<4<<endl<<type<<endl<<number<<endl<<name<<endl<<sex<<endl<<birthday<<endl<<maths<<endl<<computer<<endl<<english<<endl;
	out<<department2<<endl<<major2<<endl<<post1<<endl;
	out.close();
}
//
void teacher::print()
{
	common_people::print();
	cout<<"ϵ:"<<department2<<"    רҵ:"<<major2<<"   ְλ:"<<post1<<endl;

}

//
void teacher::getnode()
{
   ptr=new teacher(name,number,sex,birthday,department2,major2,post1);

}

#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -