Thread: map container class

  1. #1
    Stinking it up. StinkyRyan's Avatar
    Join Date
    Jun 2004

    map container class

    I'm so lost with it I know vector is effcient for most problems where as list is good for adding to the front and back but from the tutorial I am reading:
    Which has explained everything else in the stl library well but the map container and mulimap make no sense i almost got the idea it was like a multideminsial array or somthing but i have a feeling its not.
    Because I can't.

  2. #2
    Registered User
    Join Date
    Apr 2002
    The map and multi-map are known as "associative" containers. You use them when you need to associate a type with another type. Hopefully you can think of a lot of uses for maps right now. In maps, the keys must be unique whereas in multi-maps they do not have to be. The key is the parameter you specify when you create a map and the second is what will be stored. In VC6 maps are implemented through Red-Black binary search tree. This allows for very fast data retrieval. You should just make some sample programs and try different things with maps. There are one of my favorite STL containers. Also whenever you insert into the map it keeps everything in order using the operator < to sort or a user defined comparison functor.
    "...the results are undefined, and we all know what "undefined" means: it means it works during development, it works during testing, and it blows up in your most important customers' faces." --Scott Meyers

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Getting an error with OpenGL: collect2: ld returned 1 exit status
    By Lorgon Jortle in forum C++ Programming
    Replies: 6
    Last Post: 05-08-2009, 08:18 PM
  2. Need help to build network class
    By weeb0 in forum C++ Programming
    Replies: 0
    Last Post: 02-01-2006, 11:33 AM
  3. help with STL container remove_if on a class
    By Syneris in forum C++ Programming
    Replies: 19
    Last Post: 01-31-2006, 01:56 AM
  4. Mmk, I give up, lets try your way. (Resource Management)
    By Shamino in forum Game Programming
    Replies: 31
    Last Post: 01-18-2006, 09:54 AM
  5. Abstract class problem
    By VanJay011379 in forum C++ Programming
    Replies: 9
    Last Post: 07-31-2002, 01:30 PM