(C) Text Formatting in Console Apps?
Hey, i was wondering if it is possible to, for example, colorize specific text in a win32 console app? Or rather, i'm pretty sure that it's possible, but how? = )
Another side-question. Is it possible to create hash-tables, like in Java, in C? If so, i'd love to see how
Thanks in advance
>> Hey, i was wondering if it is possible to, for example, colorize specific text in a win32 console app?
You'd probably want the SetConsoleTextAttribute() function. See http://msdn.microsoft.com/library/de...tattribute.asp for documentation and code examples.
>> Is it possible to create hash-tables, like in Java, in C?
Yes, it is. There are third party libraries available that do just that. If you want to use C++, instead of C, you should look at the documentation for the Standard Template Library. Alternatively, if you wish to use MFC, you can use CStringList or inherit from CObList. See http://msdn.microsoft.com/library/de...3a.CObList.asp for more info.
Happy reading :)
Thanks a bunch! = )
I were scared senseless at first glance at that function, but in the end, my n00b-app both received coloured text as well as a proper title. Yay!
Now for those hash-tables! They should be a boon compared to the huge arrays currently in use. At one point, my exe ended up at 3.4 megs and it's really just a little app, all because of too big strings in too many arrays = )