Graphics图形函数的问题

来源:百度知道 编辑:UC知道 时间:2024/05/16 17:48:40
/*×××××××××××××××××××××××××*/
#include<time.h>
#include <process.h>
#include <stdlib.h>
#include <stdio.h>
#include <dos.h>
#include <conio.h>
#include <graphics.h>
/*#define Key_DOWN 80
#define Key_UP 72
#define Key_ESC 1
#define Key_ALT_F 33
#define Key_ALT_X 45
#define Key_ENTER 28 */
int getkey()
{
union REGS rg;
rg.h.ah=0;
int86(0x16,&rg,&rg);
return rg.h.ah;
}
void choosing(int this,int last);
void rect(int x1,int y1,int x2,int y2,int bordersize,int color1,int color2,int status);
char *m1[]={" Borrow Book"," Return Book"," Search Book"," Manage of Book","Manage of Borrower"," Exit"};
void main()
{time_t lt;
int i,gdrive=DETECT,gmode;
int current=1,past=0,key0,key1;
char ch;
registerbgidriver(EGAVGA_driver);
initgraph(&gdrive,&gmode,

孩子,你这段程序是自己编的吗?
挺不错滴,可这是笔误么?
①initgraph()函数里的BGI路径冒号都没有了!
②asctime(localtime(<)这里我是编译通不过滴,不知道你怎么样呢?
③closegraph()函数无法执行?!故意的么?
第三个错误害得我的虚拟机当机N次啊!为什么呢!因为你的循环里用了exit(0)语句直接退出程序,所以程序根本走不到closegraph().
至于你的Link Error错误,①看看graphics模式开启没有:Options->Linker->Graphics Library->On,默认是off了滴②看看你的BGI文件路径设置正确没有

还需要认真修改啊,呵呵.