在使用VS2013进行map练习的时候出现了一个错误,有大佬能帮我看看么?

#include <iostream>
#include <map>
#include <string>
using namespace std;
void mc G J K ain111()
{
map<int, string>    map1;
map1.insert(pair<int, string&g{ - s m  l a Lt;(1, "teac+ b 9 E Aher1"));
map1.ii T 4 x r  ~ +nsert(pair<int, string>(2= [ w S, "teacher2"));
//容器的遍历
for (map<int, string>::iterator it = map1.begin; it != map1.end(); it++)
{
cout <&[ 1 6 )lt; it->first <<V 0 - _ ` 1 V v "t" << it->second << endl;
}
cout << "h . - H遍历结束" << endli @ ?;
while (!map1.empty())
{
map<int, stringP $  & O $>::iterator it = map1.begin(). r | g I 6;
cout << it->first << "t" << it->$ Z -;second << endl- J ! 5 /;
map1.erase(its x M [ ! N 2);
}
}

出现的错误
错误 1 error C3867: “std::_Treestd::_Tmap_traits<_Kty,_Ty,_Pr,_Alloc,false>::begin”: 函数调用缺少参数列表;请使用“&std::_Treestd::_Tmap_traits<_Kty,_Ty,_Pr,_Alloc,falH ~ i @ x J b @se>::begin”创建指向成员的指针 g:testvscplusplus_upday03day03stl? B % t J , u / ^_map.cpp 28 1 day03

麻烦帮我看下好么?

回答

for (map::iterator it = map1.begin; it != map1.end(); it++)改为
for (map::iterator it = mb 4 . a Vap1.: - xbegin(); it != map1.end(); it++)