Tag: 代码块

如何在code :: blocks中更改文本颜色和控制台颜色?

我正在用C编写程序。我想在控制台中更改文本颜色和背景颜色。 我的示例程序是 – #include #include #include #include #include int main(int argc,char *argv[]) { textcolor(25); printf(“\n \n \t This is dummy program for text color “); getch(); return 0; } 当我编译这个程序代码:: blocks给我一个错误 – textcolor未定义。 为什么会这样? 我在GNU GCC编译器和Windows Vista中工作。 如果它不起作用什么是textcolor的副本。 就像我想要改变控制台的背景颜色。 编译器给出了同样的错误,只是函数的名称不同。 如何更改控制台和文本的颜色。 请帮忙。 即使答案是在C ++中,我也没关系。

在C中对gotoxy的未定义引用

我正在尝试用C语言编写程序(Windows中的代码::块)。 我添加了下面的头文件,它编译时没有错误,但是当它运行代码时,它会抛出一个错误未定义的引用gotoxy。 找到完整的代码。 我遇到gotoxy语句时会出现错误。 # include # include # include # include # include #include struct node { int data; struct node *link; }; void append(struct node **,int); void in_begin(struct node **,int); void del(struct node **,int); void in_middle(struct node **,int,int); int count(struct node *); void display(struct node *); char ans; int main() { struct node […]