首页 > 代码库 > hash_map

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);}