Tutorials Shared by the Internet Community
|Top Tutorials||New Tutorials||Submit||Login||Register|
Tutorial Basic Detail
Total Hits: 16918
Total Votes: 146 votes
Average Rating: 3.84 out of 5
Category: C and C++/Game Programming
Description:As you can now already see, it doesn't take much effort to make colored text.
The set_color function dose all of the magic. We start off by making a output handle. Then, we set
the console text using SetConsoleTextAttribute. Its first argument is what it should change. We use
the handle that we just made to tell it that we want to edit the color of the output text. The second argument
is the number of the color you want to change to. When you call the
set_color function, we put a number of the color we want to change
the text to. Try to figure out most of the colors on your own.
All I'm gonna say is if you give the function more then a one didget
number, the background color of the text will change, too.