帮忙看下这个程序Error executing cl.exe. (VC6.0)
#include <iostream>
#include <utility>
#include <vector>
#include <string>
#include <map>
using namespace std;
int main()
{
map<string, vector<pair<string,string> > > children;
string surname;
string child,birth;
while(1)
{
cout<<"input the surname: "<<endl;
cin>>surname;
if (!cin)
{
cin.clear();
cin.ignore();
break;
}
vector<string> childrenname;
pair<map<string,vector<pair<string,string> > >::iterator,bool> ret=children.insert(make_pair(surname,childrenname));
if (!ret.second)
{
cout<<"there is a same name"<<endl;
continue;
}
cout<<"input all the child's name and child's birthday"<<endl;
while (cin>>child>>birth)
{
ret.first->second.push_back(make_pair(child,birth));
}
cin.clear();
cin.ignore();
}
cout<<"input the surname you want to "<<endl;
cin>>surname;
if(children.count(surname))
for (vector<pair<string,string> >::iterator iter=children[surname].begin();iter!=children[surname].end();iter++)
{
cout<<(*iter).first<<" "<<(*iter).second<<endl; //error C2228: left of '.first' must have class/struct/union type
//second' must have class/struct/union type
}
return 0;
}