Header File
conio.h
Category
Console I/O Routines
Prototype
void textbackground(int newcolor);
Description
Selects new text background color.
Once you have called textbackground, all subsequent functions using direct video output (such as cprintf) will use newcolor. textbackground does not affect any characters currently onscreen.
The following table lists the symbolic constants and the numeric values of the allowable colors:
BLACK |
0 |
BLUE |
1 |
GREEN |
2 |
CYAN |
3 |
RED |
4 |
MAGENTA |
5 |
BROWN |
6 |
LIGHTGRAY |
7 |
Return Value
None.
Example
#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; }
Portability
POSIX |
Win32 |
ANSI C |
ANSI C++ |
|
+ |
|
|
Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
|
What do you think about this topic? Send feedback!
|