Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Help with CMap

Help with CMap

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Stefan Dahlin
    wrote on last edited by
    #1

    I'm currently using a CMap because i need to associate a key with a specific value. But i also need to retreive the keys in a specific order. Is it possible to sort the keys in a map? Is there any other way to get the map functionality and be able to sort the keys?

    N 1 Reply Last reply
    0
    • S Stefan Dahlin

      I'm currently using a CMap because i need to associate a key with a specific value. But i also need to retreive the keys in a specific order. Is it possible to sort the keys in a map? Is there any other way to get the map functionality and be able to sort the keys?

      N Offline
      N Offline
      Neville Franks
      wrote on last edited by
      #2

      Stefan Dahlin wrote: I'm currently using a CMap because i need to associate a key with a specific value. But i also need to retreive the keys in a specific order. Is it possible to sort the keys in a map? From memory CMap uses a hash table, in which case the answer is no. Stefan Dahlin wrote: Is there any other way to get the map functionality and be able to sort the keys? Yes move to STL. Look at Map and Multimap. Also this CP article may be of interest: http://www.codeproject.com/vcpp/stl/bimap.asp[^] Neville Franks, Author of ED for Windows. www.getsoft.com Make money with our new Affilate program

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups