⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 servers.h

📁 SSD6网上教程全部练习及答案 原版的正确答案
💻 H
字号:
/*
	servers.h

	Open a TCP/IP connection to a server, request the specified
	information, and return the information required in a struct.
 */
#include <string>
using namespace std;

/*
	Personal

	Personal information about the owner of an account.
 */
struct Personal {
	Personal( int account, string *firstname, string *lastname,
		string *address ) {

		FirstName = firstname;
		LastName = lastname;
		Account = account;
		Address = address;
	}
	~Personal() {
		delete FirstName;
		delete LastName;
		delete Address;
	}
	string *FirstName;
	string *LastName;
	string *Address;
	int Account;
};

/*
	Personal *GetPersonalInformation( int account )

	Retrieve personal information about the user of a certain account.
	Return NULL if there is no such account.
 */
Personal *GetPersonalInformation( int account );

/*
	AccountInfo

	A struct to hold account-related information.
 */
struct AccountInfo {
	AccountInfo( int account, int balance_in_cents, int share, int pending ) {
		Account = account;
		Balance = balance_in_cents;
		Share = share;
		Pending = pending;
	}
	int Account;
	int Balance;
	int Share;
	int Pending;
};

AccountInfo *GetAccountInformation( int account );

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -