C++迷惑部分
C++ confused parts
Question1 return of what?
map<string,int> getTestedmapRef(){
map<string,int> counterMap;
counterMap.insert({"word1",2});
counterMap.insert({"word2",3});
counterMap.insert({"word3",1});
return counterMap;
}
map<string,int>* getTestedmap(){
map<string,int> *counterMap=new map<string,int>();
counterMap->insert({"word1",2});
counterMap->insert({"word2",3});
counterMap->insert({"word3",1});
return counterMap;
}