菜鸟C的问题

[复制链接]
查看11 | 回复4 | 2010-7-30 17:51:47 | 显示全部楼层 |阅读模式
题目:Press any key to change color, do you want to try it. Please
hurry up!
___________________________________________________________________
程序源代码:
#include
void main(void)
{
int color;
for (color = 0; color < 8; color++)
{
textbackground(color); /*设置文本的背景颜色*/
cprintf(“This is color %d\r\n”, color);
cprintf(“ress any key to continue\r\n”);
getch(); /*输入字符看不见*/
}
}
以上是网上找的,但是我在编译器上通不过,为什么
我用的是VC啊 ,加上#include "stdio.h"没用,现在有个错误是'textbackground' : undeclared identifier ,有没有能让vc执行这个函数的办法啊

回复

使用道具 举报

千问 | 2010-7-30 17:51:47 | 显示全部楼层
textbackground()函数是TC特有的,VC++不提供这个函数。
回复

使用道具 举报

千问 | 2010-7-30 17:51:47 | 显示全部楼层
你的编译器是什么?
回复

使用道具 举报

千问 | 2010-7-30 17:51:47 | 显示全部楼层
加上#include "stdio.h"看看
回复

使用道具 举报

千问 | 2010-7-30 17:51:47 | 显示全部楼层
你的编译器可能跟此C语言不兼容,换个试试
回复

使用道具 举报

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

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行