diff --git a/src/data.c b/src/data.c index 489655a..feca189 100644 --- a/src/data.c +++ b/src/data.c @@ -1,7 +1,28 @@ +#define NAME_LEN 31 +#define MAX_PARTS 100 + +struct students +{ + int number; + char name[NAME_LEN + 1]; + int score; +}; +static struct students stu[MAX_PARTS]; +static int num_parts = 0; #include #include - +//定义常量 +#define CMD_QUIT 0 +#define CMD_QUERY 4 +#define CMD_INSERT 5 +#define CMD_UPDATE 6 +#define CMD_DELETE 7 +#define CMD_READ 1 +#define CMD_SAVE 2 +#define CMD_PRINT 3 +#define CMD_SORT 8 +#define CMD_CHART 9 // 函数定义 void init(void) diff --git a/src/data.h b/src/data.h index 4e73be7..a5ef5e2 100644 --- a/src/data.h +++ b/src/data.h @@ -1,27 +1,6 @@ #define NAME_LEN 31 #define MAX_PARTS 100 -struct students -{ - int number; - char name[NAME_LEN + 1]; - int score; -}; -static struct students stu[MAX_PARTS]; -static int num_parts = 0; - -//定义常量 -#define CMD_QUIT 0 -#define CMD_QUERY 4 -#define CMD_INSERT 5 -#define CMD_UPDATE 6 -#define CMD_DELETE 7 -#define CMD_READ 1 -#define CMD_SAVE 2 -#define CMD_PRINT 3 -#define CMD_SORT 8 -#define CMD_CHART 9 -// 菜单命令的编号 // 函数声明 void init(void);