LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 553|回复: 0

[请教]用DJGPP编译的问题

[复制链接]
发表于 2007-3-19 12:56:34 | 显示全部楼层 |阅读模式
程序要在显示器上输出 Hello,world!

源代码:
/* hello_s.c */
#define                BLACK                 0
#define                BLUE                  1
#define                GREEN                 2
#define                CYAN                  3
#define                RED                   4
#define                MAGENTA               5
#define                BROWN                 6
#define                LIGHTGRAY             7
#define                DARKGRAY              8
#define                LIGHTBLUE             9
#define                LIGHTGREEN           10
#define                LIGHTCYAN            11
#define                LIGHTRED             12
#define                LIGHTMAGENTA         13
#define                YELLOW               14
#define                WHITE                15
#define                BLINK                28

void write_string(char *pstring, int color)
{
    char far *pvideo = (char far *)0xB8000000;
    while(*pstring)
    {
        *pvideo=*pstring;
        pstring++;
        pvideo++;
        *pvideo=color;
        pvideo++;
    }
}

void main(){
    write_string("Hello,world!", RED);
}

但是编译出错:


但是同样的源代码在 TurboC3.0 中编译就没有问题。

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?注册

x
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表