Probably the most asked question in windows converted to linux:
How can you have collored text in a linux console program.
And if anyone knows, in gVIM, how do you get it to keep you color scheme?
Probably the most asked question in windows converted to linux:
How can you have collored text in a linux console program.
And if anyone knows, in gVIM, how do you get it to keep you color scheme?
This search would probably be more effective than just 'color'
http://www.cprogramming.com/cboard/s...der=descending
This is how I do it
I believe that there are various alternativesCode:char green[11]="\033[1;32m"; char blue[11]="\033[1;34m"; printf("%sThis is how you use colors\n", blue); printf("%s-------------------\n", green);
why [11] and not [8]?Originally posted by unixOZ
This is how I do it
I believe that there are various alternativesCode:char green[11]="\033[1;32m"; char blue[11]="\033[1;34m"; printf("%sThis is how you use colors\n", blue); printf("%s-------------------\n", green);
hello, internet!
>>why [11] and not [8]?
Why not [] ?
char green[]="\033[1;32m";
When all else fails, read the instructions.
If you're posting code, use code tags: [code] /* insert code here */ [/code]
here is a good explanation:
http://www.linuxgazette.com/issue65/padala.html
-Luke
PS:
next time try:
http://www.google.com/linux
Asking the right question is sometimes more important than knowing the answer.
Please read the FAQ
C Reference Card (A MUST!)
Pointers and Memory
The Essentials
CString lib