Re: [Dev-C++] Lookup tables, with bsearch, lsearch, qsort etc.
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Daniel G. <sp...@ho...> - 2003-01-16 08:12:25
|
I'll have to go look all these up. I want to try the lookup table because it was recommended by a peer, and I don't know how to do it so two very good reasons there. I'm using MFC, is STL included with that or do I need to #include some header files? >From: "Ioannis Vranos" <no...@ho...> >To: <dev...@li...> >Subject: Re: [Dev-C++] Lookup tables, with bsearch, lsearch, qsort etc. >Date: Wed, 15 Jan 2003 18:27:19 +0200 (GTB Standard Time) > >From standard library you can use map, etc. > > > >Ioannis Vranos > >* Programming pages: http://www.noicys.freeurl.com >* Alternative URL: http://run.to/noicys > > >-------Original Message------- > >From: Daniel Glenfield >Date: Wednesday, 15 January 2003 5:59:53 PM >To: dev...@li... >Subject: [Dev-C++] Lookup tables, with bsearch, lsearch, qsort etc. > >I'm trying to understand lookup tables and the bsearch, lsearch, qsort >functions. I'm trying to create a structure with an integer and a text >string, and I want to look up the number and get the text associated with >it. for example, at the moment I have > >// BIG switch here >switch (PaperSize) // can be 1 - 41 >{ >case 1: ListBox = "Paper Type: Letter"; >Listbox->AddString(ListBoxChoice); >break; > >case 2: //... the same again >//... >case 41: // same again > > >I'm trying to replace this with a lookup table but I'm finding it difficult >- examples on the net about bsearch are not quite what I need. > > >------------------------------------------------------- >This SF.NET email is sponsored by: Take your first step towards giving >your online business a competitive advantage. Test-drive a Thawte SSL >certificate - our easy online guide will show you how. Click here to get >started: http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0027en >_______________________________________________ >Dev-cpp-users mailing list >Dev...@li... >TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm >https://lists.sourceforge.net/lists/listinfo/dev-cpp-users _________________________________________________________________ Help STOP SPAM: Try the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=features/junkmail |