C Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming LanguagesC Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old May 16th, 2003, 11:54 AM
Hydrasil Hydrasil is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2003
Posts: 3 Hydrasil User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
(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

Reply With Quote
  #2  
Old May 16th, 2003, 01:51 PM
Scorpions4ever's Avatar
Scorpions4ever Scorpions4ever is offline
Banned ;)
Dev Shed God 6th Plane (7500 - 7999 posts)
 
Join Date: Nov 2001
Location: Glendale, Los Angeles County, California, USA
Posts: 7,504 Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level) 
Time spent in forums: 1 Month 20 h 49 m 18 sec
Reputation Power: 865
>> 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

Reply With Quote
  #3  
Old May 16th, 2003, 06:15 PM
Hydrasil Hydrasil is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2003
Posts: 3 Hydrasil User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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 = )

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesC Programming > (C) Text Formatting in Console Apps?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway