user.cpp
来自「近日做C++课程设计时写的一个民航订票系统」· C++ 代码 · 共 67 行
CPP
67 行
#include "string.h"
#include "iostream.h"
#include "iomanip.h"
#include "User.h"
CUser::CUser()
{
}
CUser::~CUser()
{
}
char * CUser::GetUserID()
{
return userID;
}
char * CUser::GetPassword()
{
return password;
}
int CUser::GetPopedom()
{
return popedom;
}
void CUser::SetUserID(char *ID)
{
strcpy(userID, ID);
}
void CUser::SetPassword(char *psd)
{
strcpy(password, psd);
}
void CUser::SetPopedom(int pdm)
{
popedom = pdm;
}
CUser CUser::operator=(const CUser &right)
{
strcpy(userID, right.userID);
strcpy(password, right.password);
popedom = right.popedom;
return *this;
}
CUser::CUser(const CUser &right)
{
strcpy(userID, right.userID);
strcpy(password, right.password);
popedom = right.popedom;
}
void CUser::Show()
{
cout<<"╔--------------------------------------------------------╗\n";
cout<<" |"<<"用户名"<<"|"<<"用户密码"<<"用户权限"<<"|"<<endl;
cout<<" |"<<setw(6)<<userID<<"|"<<setw(8)<<password<<"|"<<setw(8)<<popedom<<"|"<<endl;
cout<<"╚--------------------------------------------------------╝\n";
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?