资源简介
一款基于graphics实现的图书管理系统,拥有如同MFC一样的界面

代码片段和文件信息
#include“stdlib.h“
#include“stdio.h“
#include“graphics.h“
#include“string.h“
#include“conio.h“
#define file “c:\\bookdata.txt“
#define ufile “c:\\userdata.txt“
#define bfile “c:\\borrowdata.txt“
int bookcount;
int usercount;
int borrowcount;
int booksum;
int myborrow;
int flg=0;
int esc=0;
int flag=0;
/************定义输出字符的函数*************/
void pchar(int xint ychar c)
{
gotoxy(xy);
putch(c);
}
/**********************定义画边框的函数*************/
void box(int xint yint wint height)
{
int i;
pchar(xy218);/*left up*/
pchar(x+w-1y191); /* right up*/
for(i=0;i {
pchar(x+1+iy196);
pchar(x+1+iy+height-1196);
}
pchar(xy+height-1192);
pchar(x+w-1y+height-1217);
for(i=0;i {
pchar(xy+1+i179);
pchar(x+w-1y+i+1179);
}
}
/********************定义画横线的函数*************/
void h_line(int xint yint w)
{
int i;
for(i=0;i pchar(x+iy196);
}
void h_line_close(int xint yint w)
{
int i;
pchar(xy195);
h_line(x+1yw-2);
pchar(x+w-1y180);
}
/***********************定义画填充矩形的函数*************/
void bar_(int xint yint wint heightint color)
{
int ij;
textcolor(color);
textbackground(color);
for(i=0;i {
gotoxy(xy+i);
for(j=0;j putch(‘ ‘);
}
}
/*************************定义画竖线的函数*************/
void v_line(int xint yint height)
{
int i;
for(i=0;i pchar(xy+i179);
}
/****************模拟菜单条******************/
void menu()
{
bar_(1258017);
}
typedef struct book/*图书结构体*/
{
char num[10]; /*书号*/
char name[10]; /*书名*/
char auth[10]; /*作者*/
int count;
int sum;
}Book;
/*定义节点*/
typedef struct node
{
Book data;
struct node *next;
}Bnode*blink;
/*******保存图书*******/
/*******保存图书*******/
void save(blink l)
{
FILE* fp;
Bnode *p;
int flag=1count=0;
fp=fopen(file“wb“);
if(fp==NULL)
{
printf(“\n=====>open error!\n“);
exit(1);
}
p=l->next;
while(p)
{
if(fwrite(psizeof(Bnode)1fp)==1)
{
p=p->next;
count++;
}
else
{
flag=0;
break;
}
}
if(flag)
{
/* printf(“save success.(saved%d.)\n“count); */
}
fclose(fp);
}
/*******图书定位******/
Bnode* locate(blink lchar findmess[]char nameornum[])
{
Bnode *r;
if(strcmp(nameornum“num“)==0)
{
r=l->next;
while(r!=NULL)
{
if(strcmp(r->data.numfindmess)==0)
return r;
r=r->next;
}
}
else if(strcmp(nameornum“name“)==0)
{
r=l->next;
while(r!=NULL)
{
if(strcmp(r->data.namefindmess)==0)
return r;
r=r->next;
}
}
return 0;
}
/*******图书的添加******/
void add(blink l)
{
Bnode *p*r*s;
char num[10];
r=l;
s=l->next;
while(r->next!=NULL)
r=r->next;
textcolor(RED);
gotoxy(254);
cputs(“INPUT THE MESSAGE ABOUT BOOK“);
gotoxy(3110);
textcolor(YELLOW);
cputs(“Book ID:“)
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2019-01-04 10:22 C语言图书管理系统\
文件 57344 2015-03-31 17:51 C语言图书管理系统\graphics.lib
目录 0 2019-01-04 10:22 C语言图书管理系统\Include\
文件 13007 2019-01-02 09:37 C语言图书管理系统\Include\easyx.h
文件 5247 2019-01-02 09:37 C语言图书管理系统\Include\graphics.h
目录 0 2019-01-04 10:22 C语言图书管理系统\lib2015\
目录 0 2019-01-04 10:22 C语言图书管理系统\lib2015\amd64\
文件 258044 2019-01-02 09:37 C语言图书管理系统\lib2015\amd64\easyx.lib
文件 260408 2019-01-02 09:37 C语言图书管理系统\lib2015\amd64\easyxw.lib
文件 181850 2019-01-02 09:37 C语言图书管理系统\lib2015\easyx.lib
文件 184076 2019-01-02 09:37 C语言图书管理系统\lib2015\easyxw.lib
文件 39802 2019-01-04 10:21 C语言图书管理系统\main.c
文件 35819 2019-01-04 10:21 C语言图书管理系统\wellcome.c
文件 1241600 2015-03-31 17:51 C语言图书管理系统\学生管理系统.ppt
文件 58 2019-01-04 10:21 C语言图书管理系统\说明.txt
相关资源
- VC++ 多线程文件读写操作
- 移木块游戏,可以自编自玩,vc6.0编写
- VC++MFC小游戏实例教程(实例)+MFC类库
- VC++实现CMD命令执行与获得返回信息
- Qt画图工具源码(qgraphics draw)
- VC++基于OpenGL模拟的一个3维空间模型
- 北京化工大学计算方法(C/C++)讲义
- 基于VC++的SolidWorks二次开发SolidWorks
- GBT 28169-2011 嵌入式软件 C语言编码规范
- XUnZip Zip解压缩.rar
- Windows_API_函数大全 C/C++
- 派克变换VC++源码(附文档)
- VC++ 串口
- C语言程序设计教材习题参考答案.do
- VC++ 大富翁4_大富翁游戏源码
- VC++ 摄像头视频采集与回放源程序
- 转 VC++ 实现电子邮件(Email)发送
- 基于MFC的VC++仿QQ浏览器源码(雏形)
- VC++ 服务程序编写及安装与卸载
- VC++6.0番茄西红柿VAXvirsual assist X完美破
- 基于改进的fcm算法的图像分割vc++
- VC++6.0 绿色版,免安装,非常好用。
- Microsoft Visual C++ 2005 Redistributable Pack
- VC++MFC课程设计的学生成绩管理系统
- 大智慧365DLL插件设计
- 高效FFT的C/C++代码实现包括基2的DIF和
- c/c++开发网络验证和本地验证
- 操作系统存储管理实验报告c/c++
- VC++6.0汉化包
- VC++完整商业界面源码(再上传)
评论
共有 条评论