乡镇和街道的区别:如何在C语言中改变颜色

来源:百度文库 编辑:高考问答 时间:2024/05/01 12:08:04
如何在C语言中改变字体,背景的颜色

函数名: textbackground
功 能: 选择新的文本背景颜色
用 法: void textbackground(int color);
程序例:

#include <conio.h>

int main(void)
{
int i, j;

clrscr();
for (i=0; i<9; i++)
{
for (j=0; j<80; j++)
cprintf("C");
cprintf("\r\n");
textcolor(i+1);
textbackground(i);
}

return 0;
}

函数名: textcolor
功 能: 在文本模式中选择新的字符颜色
用 法: void textcolor(int color);
程序例:
#include <conio.h>

int main(void)
{
int i;

for (i=0; i<15; i++)
{
textcolor(i);
cprintf("Foreground Color\r\n");
}

return 0;
}