如何在C语言中改变颜色

如题所述

第1个回答  2019-06-13
函数名:
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;
}
相似回答