|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
(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 -Simon |
|
#2
|
||||
|
||||
|
>> 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/d...xtattribute.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/d...a3a.CObList.asp for more info. Happy reading ![]() |
|
#3
|
|||
|
|||
|
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 = ) |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > C Programming > (C) Text Formatting in Console Apps? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|