📄 common_people.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 + -