继续这个问题,我正在尝试访问地图。但是我遇到了分段错误。下面是我的代码:
typedef multimap<string, vector<string> > mos_map;
typedef multimap<string, vector<string> >::iterator mos_map_it;
int main()
{
mos_map mos;
mos_map_it it;
vector<string> v1;
v1.push_back("a");
v1.push_back("b");
v1.push_back("c");
v1.push_back("mo1");
mos.insert(mos_map::value_type(*(v1.end()-1),v1));
for(it=mos.begin();it!=mos.end();it++);
{
cout<<(*it).first<<endl;//seg fault occurs here
}