- #include<map>
- map<key, value>MapName;
- element.first 和 element.second 访问 key 和 value。
-
- 关于迭代器 map<key, value> :: iterator ite;
- 用迭代器遍历map
for(ite = Map.begin(); ite != Map.end(); ite++)
cout << ite->first << ite->second << endl;
for(ite = Map.begin(); ite != Map.end(); ite++)
cout << ite->first << ite->second << endl;
相关文章: