?? client.cpp
字號:
#include "Client.h"
//Default constructor Initializes the private data members to default values
Client::Client(void)
{
fname = "";//frist name
lname = "";//last name
email = "";//email of client
passwd = "";//password of client
}
//copy constructor
Client::Client(Client const &c)
{
this->fname=c.fname;
this->lname=c.lname;
this->email=c.email;
this->passwd=c.passwd;
}
//constructor set private data members
Client::Client (string &fname, string &lname, string &email, string &passwd)
{
this->fname=fname;
this->lname=lname;
this->email=email;
this->passwd=passwd;
//set the private data members
void Client::setFname(const string& c)
{
this->fname=c;
}
void Client::setLname(const string& c)
{
this->lname=c;
}
void Client::setEmail(const string& c)
{
this->email=c;
}
void Client::setPasswd(const string& c)
{
this->passwd=c;
}
//return the private data members
string Client::getFname () const
{
return fname;
}
string Client::getLname () const
{
return lname;
}
string Client::getEmail () const
{
return email;
}
string Client::getPasswd () const
{
return passwd;
}
//Returns true if the invoking object's password matches the password given in the parameter, false if otherwise
bool Client::verifyPasswd(string passwd)
{
if(this->passwd==passwd)
else
return 0;
}
//over loading operator>> reads a Client object from an input stream
istream &operator>>(istream &is, Client &c)
{
string t;
is >> t;
c.setFname(t);
is >> t;
c.setLname(t);
is >> t;
c.setEmail(t);
is >> t;
c.setPasswd(t);
return is;
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -