/* Lecture Code 6.1 * * Basic STL map usage. */ #include #include #include using namespace std; int main() { map myMap; myMap.insert(make_pair("STL", 137)); myMap.insert(make_pair("IS", 42)); myMap.insert(make_pair("AWESOME", 2718)); myMap["AWESOME"] = 271828; myMap.erase("IS"); if(myMap.find("STL") != myMap.end()) cout << "The STL exists." << endl; for(map::iterator itr = myMap.begin(); itr != myMap.end(); ++itr) cout << "Key: " << itr->first << ", Value: " << itr->second << endl; return 0; }