![]() |
|
#1
|
|||
|
|||
Changing font style and color of text in CThe text color and font is the same throughout the whole exe file. How can I call library and change them?
I want to set the given numbers to red in a sudoku. P.S. Are there any online sudoku source codes in C? Thank you. |
|
#2
|
|||
|
|||
Re: Changing font style and color of text in CQuote:
Since you refer to "exe" file, I am assuming you are running some version of Windows. You might tell us which version (Windows98, XP, or what?) Sometimes it makes a difference (but probably not, for this particular question). I assume you aren't running a "Windows" API program (the stuff with handles, winmain, etc.), but a command line program (the program has a main() function and runs in a "command prompt" window). (If you were running Windows API, then, depending on how you are actually displaying program output, there are tons of ways to change the appearance.) There aren't any standard C library functions that have any awareness of stuff like fonts and colors, etc., or anything else that is associated with physical attributes of your screen or anything else in your system. This is deliberate and by design, since the idea is that the language and its standard library functions are to be as portable as possible among the many, many (well, maybe not that many) operating systems and hardware implementations. For command-line C (or C++) programs running on Windows XP (and, probably some earlier versions of Windows also), here is a site with lots of stuff that I found very interesting: http://www.adrianxw.dk/SoftwareSite/...Consoles1.html Start at the beginning and go forward a few lessons to get to the color stuff. Linux users/programmers might look into the ncurses library to control screen output in a non-GUI console window. (Ncurses may already be on your system, depending on what Linux distribution you have installed.) Regards, Dave |
Recent GIDBlog
Stupid Management Policies by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The