You mean to the paper or the screen.
if you want on the screen use conio.h
Colors
------
0 BLACK /* dark colors */
1 BLUE
2 GREEN
3 CYAN
4 RED
5 MAGENTA
6 BROWN
7 LIGHTGRAY
8 DARKGRAY /* light colors */
9 LIGHTBLUE
10 LIGHTGREEN
11 LIGHTCYAN
12 LIGHTRED
13 LIGHTMAGENTA
14 YELLOW
15 WHITE
1.textbackground(int) to change the background color
2.textcolor(int) to change text color
Now you can call any to the above funtions as below:
textcolor(2); //green color
textcolor(BLUE); //blue text color( see the above list for more colors)
in C++ sometimes you will have to call clrscr() to clear the screen before the changes will become visible.
if you call clreol() [clear till end of line] only that line will be affected.Then when new text is typed on the next line sometimes the changes will remain other wise the old settings.
This varies from complier to compiler.I have no idea why.
gotoxy(int x,int y); //shift text cursor location, starts at 1,1
Helps ? :!: