Re: [Dev-C++] Lookup tables, with bsearch, lsearch, qsort etc.
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Per W. <pw...@ia...> - 2003-01-16 08:50:21
|
In MFC applications, you might decide to use CMap instead. /Per W On Thu, 16 Jan 2003, Daniel Glenfield wrote: > 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 > > > > ------------------------------------------------------- > This SF.NET email is sponsored by: A Thawte Code Signing Certificate > is essential in establishing user confidence by providing assurance of > authenticity and code integrity. Download our Free Code Signing guide: > http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0028en > _______________________________________________ > 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 > |