第5章 数据的共享与保护
client.cpp
#include "client.h"
void Client::ChangeServerName(char name)
{
/********** Begin **********/
Client::ServerName = name;
Client::ClientNum ++;
/********** End **********/
}
int Client::getClientNum() {
/********** Begin **********/
return Client::ClientNum;
/********** End **********/
}
client.h
#ifndef CLIENT_H_
#define CLIENT_H_
class Client
{
static char ServerName;
static int ClientNum;
public:
static void ChangeServerName(char name);
static int getClientNum();
};
#endif
EntyEnty520~