?? uthash_learn.c
字號:
#include <hash_map.h>
#include <iostream.h>
#include <string.h>
int main( )
{
using namespace std;
using namespace stdext;
hash_map <int, string> hm1;
hash_map <int, string> :: iterator hm1_Iter;
hash_map <int, string> :: const_iterator hm1_cIter;
typedef pair <int, string> Int_Pair;
hm1.insert ( Int_Pair ( 0, "令狐沖" ) );
hm1.insert ( Int_Pair ( 1, "東方不敗" ) );
hm1.insert ( Int_Pair ( 2, "任我行" ) );
hm1_cIter = hm1.begin ( );
cout << "The first element of hm1 is "
<< hm1_cIter -> first << "." << endl;
hm1_Iter = hm1.begin ( );
hm1.erase ( hm1_Iter );
// The following 2 lines would err because the iterator is const
// hm1_cIter = hm1.begin ( );
// hm1.erase ( hm1_cIter );
hm1_cIter = hm1.begin( );
cout << "The first element of hm1 is now "
<< hm1_cIter -> first << "." << endl;
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -