change color in c
-
Hello I want to change the color of text in c(win32 console). but not entire text only a piece of text that is in the middle. what can I do? best regards...
-
Hello I want to change the color of text in c(win32 console). but not entire text only a piece of text that is in the middle. what can I do? best regards...
Look in documents for the console programming API functions. I would but you can do it just as easily as I can and I don't need to. :) You can also search for articles on the console here. Most of them use C++ but at least you can see the API functions in action.
-
Hello I want to change the color of text in c(win32 console). but not entire text only a piece of text that is in the middle. what can I do? best regards...
Looks like you're after the SetConsoleTextAttribute[^] function in combination with GetStdHandle[^] with code like this:
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_RED);
Steve