// File: map3.C // // Testing the STL hash_map class. // Example modified from documentation on #include #include #include #include // C string library #include // STL hash table #include // STL string class typedef hash_map mmap ; int main() { mmap months; months["january"] = 31; months["february"] = 28; months["march"] = 31; months["april"] = 30; months["may"] = 31; months["june"] = 30; months["july"] = 31; months["august"] = 31; months["september"] = 30; months["october"] = 31; months["november"] = 30; months["december"] = 31; mmap::iterator it ; for (it = months.begin() ; it != months.end() ; it++) { cout << (*it).first << " has " ; cout << (*it).second << " days" << endl ; } }