?? person.cpp
字號:
#include"person.h"
#include<iostream.h>
#include<string.h>
#include<stdlib.h>
#include <iomanip.h>
int person::count=0;
person::person()
{
strcpy(name,"NULL");
birthday.year=9999;birthday.month=99;birthday.day=99;
sex='N';
strcpy(num,"NULL");
strcpy(nationality,"NULL");
strcpy(education,"NULL");
strcpy(address,"NULL");
strcpy(telNum,"NULL");
strcpy(Email,"NULL");
count++;
}
person::~person() {}
void person::print()
{
cout<<setw(10)<<name<<setw(8)<<birthday.year<<setw(3)<<birthday.month<<setw(3)<<birthday.day
<<setw(3)<<sex<<setw(8)<<num<<setw(6)<<nationality
<<setw(8)<<education<<setw(11) <<address<<setw(8)<<telNum<<setw(10)<<Email<<endl;
}
/*b person::get_birth()
{
return birthday;
}*/
int person::get_birth()
{
return birthday.year*10000+birthday.month*100+birthday.day;
}
void person::set_inf(char *na,int y,int m,int d,char s, char *nu,char *nation,char *ed,char *add,char *tel, char *e)
{
strcpy(name,na);
birthday.year=y;birthday.month=m;birthday.day=d;
sex=s;
strcpy(num,nu);
strcpy(nationality,nation);
strcpy(education,ed);
strcpy(address,add);
strcpy(telNum,tel);
strcpy(Email,e);
}
int person::get_ct() {return count;}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -