编程论坛's Archiver

独孤小梦 发表于 2008-7-19 23:20

为什么编译不出来啊!

谢谢大家了!呵呵,又要麻烦各位了,问题如下:
#include"stdio.h"
#include"conio.h"
void main()
{
        int color;
        for(color=0;color<8;color++)
        {
                textbackground(color);/*设置文本的背景颜色*/
                printf("This is color %d\r\n", color);
                printf("Press any key to continue\r\n");
                getchar();/*输入字符看不见*/
        }
}
textbackground这个函数是设置字符模式下的背景颜色
头文件为:conio.h啊!为什么提示:
--------------------Configuration: d - Win32 Debug--------------------
Compiling...
d.cpp
C:\Documents and Settings\admin\桌面\c\d.cpp(8) : error C2065: 'textbackground' : undeclared identifier
执行 cl.exe 时出错.

d.exe - 1 error(s), 0 warning(s)

我使用的是VC6来编译的!不知道是不是和这个有关!

[[it] 本帖最后由 独孤小梦 于 2008-7-19 23:22 编辑 [/it]]

[[it] 本帖最后由 独孤小梦 于 2008-7-19 23:22 编辑 [/it]]

ospf 发表于 2008-7-19 23:28

textbackground好像是TC提供的库函数,VC不支持的吧

独孤小梦 发表于 2008-7-19 23:32

哦,理解了!谢谢啊!那么这些库函数需要记下来吗?

lingluoz 发表于 2008-7-20 10:41

c语言么 把标准的几个函数记下来好了

lingluoz 发表于 2008-7-20 10:45

http://bbs.bccn.net/thread-221867-1-1.html
去看看这个库 我写的vc6下实现textbackground

子林 发表于 2008-7-20 11:11

回复 3# 独孤小梦 的帖子

TC 和VC是有差别的 前几天老师叫我做的小课题,在TC可以在VC就有错误了 但建议你用VC 因为TC好多都不用了哈

独孤小梦 发表于 2008-7-20 16:14

谢谢了啊!嘿嘿,真热心!

页: [1]

Powered by Discuz! Archiver 6.1.0  © 2001-2007 Comsenz Inc.