#include<map> #include<string> ... using namespace std; map<string, int> phoneBook; phoneBook["Liberti"] = 3412; phoneBook["Baptiste"] = 3800; for(map<string,int>::iterator mi = phoneBook.begin(); mi != phoneBook.end(); mi++) { cout « mi->first « ": " « mi->second « endl; } cout « phoneBook["Liberti"] « endl; cout « phoneBook["Smith"] « endl; for(map<string,int>::iterator mi = phoneBook.begin(); mi != phoneBook.end(); mi++) { cout « mi->first « ": " « mi->second « endl; } |