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

📄 common_people.h

📁 用C++编写的教师学生相关信息和统计系统
💻 H
字号:
#ifndef iostream_h
#include <iostream.h>
#endif

#include <fstream>
using namespace std;
#ifndef common_people_h
#define common_people_h

class common_people
{
    friend class list;
public:
    int type;
	char name[30];
	int number;
	char sex[30];
	char birthday[30];
    int maths,computer,english,total;
	common_people *ptr,*next;
    common_people()
		{ 
		  type=-1;
		  name[0]='\0';
		  number=-1;
		  sex[0]='\0';
		  next=NULL;
		  maths=-1;
		  computer=-1;
		  english=-1;
		  total=-1;
		}
	common_people(char *name1,int num,char *sex1,char *birth)
		{ 
		  type=-1;
		  strcpy(name,name1);
		  number=num;
		  strcpy(sex,sex1);
		  strcpy(birthday,birth);
		  next=NULL;
		  maths=-1;
		  computer=-1;
		  english=-1;
		  total=-1;
		}
    virtual void print()
		{
			cout<<"编号:"<<number<<"   姓名:"<<name<<"  性别:"<<sex<<"   出生日期:"<<birthday<<endl;
		}
	virtual void getnode(){};
    virtual void sav(char *nam);
};

void common_people::sav(char *nam)
{
	ofstream fileout(nam,ios_base::app);
	fileout<<-1<<endl<<type<<endl<<number<<endl<<name<<endl<<sex<<endl<<birthday<<endl<<maths<<endl<<computer<<endl<<english<<endl;
	fileout.close();
}
#endif

⌨️ 快捷键说明

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