hi people!
my question is how change the color of text that i send to stdout(display screen) in my linux.
What is the function and in that header file is on?
Tnks!
hi people!
my question is how change the color of text that i send to stdout(display screen) in my linux.
What is the function and in that header file is on?
Tnks!
/**************Um abraço*************/
Well the short answer is to use ANSI escape sequences
http://www.delmar.edu/Courses/CIS415L/ANSIsys.htm
Example
A better way is to use the ncurses library since that is ported to a number of different platforms.Code:printf( "\033[31mThis is Red\n" );
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
Is this ncurses library upper link or!
I tried this what you wrote on Windows. And doesent work. How can I make that in Windows. If there is some way without using windows.h or with windows.h but some easy way?
Somethink like
Code:printf(RED -> "like this");
Sorry for spelling errors, not English!
xxxrugby: "All Human Race Will Die From My Hand!"
xxxrugby: "We are all philosophers, when question is about politics!"
You use either compiler specific library functions, or you use ANSI secape sequences as stated, and hope they're displayed by your enviornment.
Quzah.
Hope is the first step on the road to disappointment.
> I tried this what you wrote on Windows. And doesent work.
Well done - you noticed that the OP said Linux.
Yes, there is a win32 version of ncurses (I'm sure google will find it).
Also, check out Adrianxw's website for win32 console tutorial.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.