链接器会在initgraph和close graph
处出现溢出错误#include<dos.h>
#define DETECT 0
union REGS in,out;
void detectmouse()//no declaration(prototype)?
{
in.x.ax=0;
int86(0x33,&in,&out);
if(out.x.ax==0)
{
printf("Fail to initialize the mouse.");
}
else
{
printf("Mouse succesfully initialized.");
}
getch();
}
void showmousegraphics()//show mouse in graphics mode
{
int driver=DETECT,mode;
initgraph(&driver,&mode,"c:\\tc\\bgi");
in.x.ax=1;
int86(0X33,&in,&out);
getch();
closegraph();
}
void main()
{
detectmouse();
showmousegraphics();
}
答案 0 :(得分:1)
啊,你可能在DOS上使用了一些旧的编译器。在这种情况下,您必须在编译时选择大内存模型,以便您可以拥有超过64kB的代码。