运行时总有一个错误 '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();
}
#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();
}
...全文
相关推荐
c++常见20个编译错误
6、error C2065: 'IDD_MYDIALOG' : undeclared identifier。此错误是由于“IDD_MYDIALOG”未声明,可能是由于未定义或未包含头文件引起的。
Windows x64下用CMake编译zlib 1.2.11:Debug/Release完整指南
数据压缩是网络传输与存储优化的基石,而zlib作为广泛使用的压缩库,支撑着PNG、HTTP gzip及ZIP格式。在Windows x64环境下,开发者常面临预编译库架构混乱、Debug与Release混杂等问题。CMake作为跨平台构建工具,能通过生成器与架构参数精准控制Visual Studio工程输出,从源头规避链接错误。利用CMake分别配置Debug和Release构建,可产出名称区分的zlibd.lib与zlib.lib,便于工程集成与调试。该方法适用于需要静态链接或动态加载的各类C/C++项目
C语言命语法错误大全
7. error C2065: 'i' : undeclared identifier该错误是由于变量'i'未定义引起的。解决方法是检查变量'i'是否已经定义,确保变量'i'在使用前已经声明。
C语言的常见错误分析,初学者
C2065: 'A': undeclared identifier` —— A 未声明- `error C3861: 'printf': identifier not found` —— 找不到 printf
C语言常见的语法错误
9.error C2146:syntax error:missing ‘;’before identifier ‘dc’该错误是由于语法错误,在dc前缺少“;”符号。


