structs.h

来自「多用户银行系统」· C头文件 代码 · 共 57 行

H
57
字号
#ifndef _STRUCTS_H_LG#define _STRUCTS_H_LG#include <unistd.h>#include <stddef.h>#include <signal.h>#include <sys/types.h>#include <sys/ipc.h>#include <sys/shm.h>#include "stddef.h"#define MAX_SIZE 10#ifndef MAX_CLIENT#define MAX_CLIENT 10#endif//typedef struct {//	char name[MAX_SIZE + 1];//	char pwd[MAX_SIZE + 1];//}USER;typedef struct {	char chara[10];	char charb[10];	char charc[10];	int  inta;	int  intb;	int  intc;			pid_t spid;	pid_t cpid;	int ok;    // errcode	int over;  // over = 1 if server has done the bussness	char mark[10];}SWAP;typedef struct userinfo{	char name[10];	char pwd[10];	int id;	int money;}USER;typedef struct {	int flag; // flag = 0 if this SWAP is used by ant process	SWAP swap;}SWAP_ARR;typedef struct {        int flag; // flag = 0 if no getSHM access SHM        SWAP_ARR swap_arr[MAX_CLIENT];}SHM;#endif

⌨️ 快捷键说明

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