Hi
My current problem stmt is :- There are n no. of cities each having unique name and each city having m no. of streets. I have all the information as in which street belong to which city and so on. I'm able to extract information from the given input file using the function GetName now i want to store this information in some data structure. My current implementation goes like
....
string CityName;
string StreetName;
GetName(CityName,StreetName);
typedef vector<string> StrName;
map<string,StrName>cityMap;
map<string,StreetName>::iterator iterMap;
iterMap=cityMap.find(CityName);
if(iterMap==cityMap.end())
{
cityMap.insert((std::make_pair(CityName,StrName.push_back(StreetName)));
}
else
{
//I want to insert value to the corresponding cityname or the returned iterator
}
I'm getting compilation error while i'm trying to insert the value. Also once the values are inserted i need to retrieve them using simple for loop.How to do that in this case.
Kindly help