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

📄 alist.h

📁 浙大《C语言设计基础课程设计》中的例程 有些比较好的代码!
💻 H
字号:
/************************************************************/
/*                File: AList.h                          */
/************************************************************/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <ctype.h>
#include <conio.h>
#include <process.h>
#include <dos.h>

/* 存储文件 */
#define FILENAME "al.dat"	
/* 文件存储块的大小 */
#define BLOCKSIZE (sizeof(struct myrecord)+10)   
#define BASE 10000
#define MAXLEN 30
 /* 输入格式列表 */
#define IFORMAT " %d %d %30s %c %d %d %d %30s %30s %30s"   
 /* 输出格式列表 */
#define OFORMAT "%6d%3d %10s\t%c\t%d-%d-%d %10s %10s %10s\n"    


/*	宏定义各键的bioskey(0)的按键返回值	*/
#define Key_DOWN  	0x5000
#define Key_UP    	0x4800
#define Key_1    	0x231
#define Key_2    	0x332
#define Key_3    	0x433
#define Key_4   	0x534
#define Key_5    	0x635
#define Key_q    	0x1071
#define Key_Q  		0x1051
#define Key_ENTER  	0x1c0d


extern FILE *fp;
extern char ch;

struct mydate{
	unsigned int year;
	unsigned int month;
	unsigned int day;
};
typedef struct mydate date;

struct myrecord{
	unsigned int num;
	unsigned int group;
	char name[MAXLEN+1];
	char gender;
	date birthday;
	char address[MAXLEN+1];
	char phone[MAXLEN+1];
	char email[MAXLEN+1];
};
typedef struct myrecord myrecord;

union mysearch_entry{
	unsigned int num;
	unsigned int group;
	char name[MAXLEN+1];
};
typedef union mysearch_entry search_entry;

extern myrecord input,output;
extern search_entry sitem;

/* 函数的声明 */
/* 输入输出函数 */
void menulist(void);
void upbar(int y);
void downbar(int y);
void mydelay(void);
myrecord *input_app(void);
void format(void);
void searchmenu(void);
void input_search(char ch);
int input_num(void);
int input_new(myrecord *p);
int date_legal(int year,int month,int day);

/* 文件维护函数 */
int file_app(myrecord *p);
myrecord *read_record(int n);
int write_record(myrecord *p,int n);
int file_search(search_entry *s,int f);
int file_delete(int n);

/* 管理控制函数 */
void append(void);
void delet(void);
void search(void);
void change(void);
void list_all(void);
void init(void);
void quit(void);

/******************** End of File: AList.h *************************/

⌨️ 快捷键说明

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