运行时总有一个错误 'int86' : undeclared identifier
我在运行的时候,总是有一个错误, 'int86' : undeclared identifier,我百度了一些说是头文件的问题,我改了一些,都不行,还是有这个错误
#include <stdio.h>
#include<conio.h>
#include<Dos.h>
struct WORDREGS
{unsigned int ax,bx,cx,dx,si,di,cflag,flags;};
struct BYTEGEGS
{
unsigned int al,ah,bl,bh,cl,ch,dl,dh;};
union REGS
{
struct WORDREGS x;
struct BYTEGEGS h;
};
void cls(void)
{ union REGS r;
r.h.ah=6; /*子功能号*/
r.h.al=0;
r.h.ch=0; /*左上角坐标*/
r.h.cl=0;
r.h.dh=24; /*右下角坐标*/
r.h.dl=79;
r.h.bh=7; /*7表示黑色*/
int86(0x10,&r,&r); /*系统功能调用*/
}
//定位子程序:
void locate(int x, int y)
{ union REGS r;
r.h.ah=2; /*子功能号*/
r.h.dh=x; /*定位点坐标*/
r.h.dl=y;
r.h.bh=0;
int86(0x10,&r,&r);
}
//在指定位置写参数:
void writech(int x , int y, char ch ,int attr)
{ union REGS r;
locate(x ,y);
r.h.ah=9;
r.h.bh=0;
r.h.al=ch;
r.h.bl=attr;
r.x.cx=1;
int86(0x10,&r,&r);
}
void main()
{int i,x=10,y=10;
cls();
for(i=0;i<26;i++)
writech(x , y+i,65+i,7);
getch();
}