Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > C# and C > C++ and Visual C++ > C++ Programming
Password Reminder
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
C++ Programming General discussions for the C++ language. For questions specific to Microsoft's Visual C++ variant, see the Visual C++ forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C++ Programming section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old February 16th, 2006, 07:16 AM
Registered User
Join Date: Feb 2006
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default STL's clarification

hi all

  could anyone tell me the difference between maps and multimaps in C++. and the advantages of using maps over multimaps.

thanks in advance

Reply With Quote
  #2 (permalink)  
Old February 23rd, 2006, 04:43 AM
Authorized User
Join Date: Oct 2004
Location: San Francisco, CA, .
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts

maps store key/value pairs. For example:

foo: bar
biz: baz

multimaps are similar, but they allow multiple values for a particular key (or duplicate keys, depending on how you look at it). So you could have:

foo: bar, bar2
biz: baz, baz2, baz3, bleh

There's really no advantage of one over the other -- it's just a matter of whether your use case involves multiple values for a single key or not.

Scott J. Kleper
Author, "Professional C++"
(Wrox, 2005)
Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
xsl clarification... rajesh_css XSLT 1 October 2nd, 2008 01:56 AM
Technical Clarification Reqd. saravananedu Access ASP 1 November 26th, 2006 06:14 PM
clarification in xslt rameshnarayan XSLT 0 August 23rd, 2005 02:28 AM
Clarification on Namespace sathya.n XML 1 March 2nd, 2005 10:24 AM
OO Advise and Clarification rodmcleay General .NET 1 October 14th, 2004 09:51 PM

All times are GMT -4. The time now is 02:47 AM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.