Setting color of text with printf()
-
Hello. I am setting up a C console application under VS.net. I have various printf statements. If some type of error condition occurs I would like to change the color of the text to RED that the printf statement prints to the console. I dont know how to change the colors for this situation. Can someone help me with this? :() Jerry
-
Hello. I am setting up a C console application under VS.net. I have various printf statements. If some type of error condition occurs I would like to change the color of the text to RED that the printf statement prints to the console. I dont know how to change the colors for this situation. Can someone help me with this? :() Jerry
printf()
knows nothing of color. Check outSetConsoleTextAttribute()
andWriteConsole()
instead.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
-
printf()
knows nothing of color. Check outSetConsoleTextAttribute()
andWriteConsole()
instead.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
Ok thanks, I got it all working. :) Jerry