0

I am using std::map to add values

std::map<CString,int>

the follwing is the list of items to be inserted as Key

  • X_1O1
  • X_101_A
  • X_70
  • X_67

I was expecting a sorted map with

  • X_67
  • X_70
  • X_101
  • X_101_A

but i am getting the result as

  • X_101
  • X_101_A
  • X_67
  • X_70

is there a way that I can sort the keys properly in the map?

Kidd09
  • 21
  • 2
  • 1
    Check [this answer](http://stackoverflow.com/a/5733353/987632) – Yara_M Oct 21 '16 at 15:24
  • Possible duplicate of [create an own comparator for map](http://stackoverflow.com/questions/5733254/create-an-own-comparator-for-map) – Quentin Oct 21 '16 at 15:27

0 Answers0