map的相关代码如下:
#include <iostream> #include <map> using namespace std; int main(int argc, char const *argv[]){ map<char, int> wordCntMap; wordCntMap['c']++; map<char, int>::iterator iter = wordCntMap.begin(); while(iter != wordCntMap.end()){ // iter->first iter->second iter++; } return 0; }