hash_map

#include <hash_map>
#include <iostream>

int main( )
{
   using namespace std;
   using namespace stdext;

   hash_map <int, CString> hm1;
   hash_map <int, CString> :: const_iterator hm1_AcIter, hm1_RcIter;
   typedef pair <int, CString> Int_Pair;

   hm1.insert ( Int_Pair ( 1, _T("aaa") ) );
   hm1.insert ( Int_Pair ( 2, _T("bbb") ) );
   hm1.insert ( Int_Pair ( 3, _T("ccc") ) );

   hm1_RcIter = hm1.find( 2 );
  AfxMessageBox( hm1_RcIter->second);
}

 

posted on 2014-06-24 10:16  上海—Michael  阅读(143)  评论(0编辑  收藏  举报