摘要: Becausemapcontainers do not allow for duplicate keys, this means that the function actually returns 1 if an element with that key is found, and zero otherwise.// map::count#include <iostream>#include <map>using namespace std;int main (){ map<char,int> mymap; char c; mymap ['a&# 阅读全文
posted @ 2011-10-13 22:07 zxfx100 阅读(392) 评论(0) 推荐(0) 编辑
摘要: // accessing mapped values#include <iostream>#include <map>#include <string>using namespace std;int main (){ map<char,string> mymap; mymap['a']="an element"; mymap['b']="another element"; mymap['c']=mymap['b']; cout << 阅读全文
posted @ 2011-10-13 21:58 zxfx100 阅读(153) 评论(0) 推荐(0) 编辑