how do you mkae colored text i just want to use the simple hello world program but have it in colored text how would i go about doing this
Thank you in advance
how do you mkae colored text i just want to use the simple hello world program but have it in colored text how would i go about doing this
Thank you in advance
http://www.adrianxw.dk/SoftwareSite/index.html
Click on colour
As long as you use windows and don't need cross platform compatability.
You didn't state your OS
sory my OS is windows xp home edtion
Well there you go, youcan use my link.
Thank you grate help to me
I have that effect on cheese
Or you could use this function:
The background and text numbers take numbers from 0 to 15. You can use these #defines:Code:void Color ( int BackgroundColor, int TextColor ) { int SeclectedColor = (16*BackgroundColor) + (TextColor); HANDLE hConsole; hConsole = GetStdHandle ( STD_OUTPUT_HANDLE ); SetConsoleTextAttribute ( hConsole, SeclectedColor ); }
example:Code:#define BLACK 0 #define BLUE 1 #define GREEN 2 #define AQUA 3 #define RED 4 #define PURPLE 5 #define YELLOW 6 #define WHITE 7 #define GREY 8 #define LIGHTBLUE 9 #define LIGHTGREEN 10 #define LIGHTAQUA 11 #define LIGHTRED 12 #define LIGHTPURPLE 13 #define LIGHTYELLOW 14 #define BRIGHTWHITE 15
Code:cout<< "Hel"; Color( BLACK, RED ); cout<< "lo wor"; Color( BLACK, BLUE ); cout<< "ld!";
Isn't that pretty much the same as what I showed him?
I know. I just showed it to him, and you showed him a link.
Right, gotcha. I just knew it was there I haven't looked at it in months.
cheers guys for heloping em out im still a newbie at C++
As am I. I just knew where to look.
Funny how just a few months ago I made a thread about this? ( and many before me ) as I came to find out through Searching
Curses! This "Raigne" fellah hath unearthed the secret to our eternal powah! Minions, casth the fool into Banniation, where he shalt suffah!
Code:#include <stdio.h> void J(char*a){int f,i=0,c='1';for(;a[i]!='0';++i)if(i==81){ puts(a);return;}for(;c<='9';++c){for(f=0;f<9;++f)if(a[i-i%27+i%9 /3*3+f/3*9+f%3]==c||a[i%9+f*9]==c||a[i-i%9+f]==c)goto e;a[i]=c;J(a);a[i] ='0';e:;}}int main(int c,char**v){int t=0;if(c>1){for(;v[1][ t];++t);if(t==81){J(v[1]);return 0;}}puts("sudoku [0-9]{81}");return 1;}