This is a problem that applies to pointers (the iterator behaves like a pointer). There are two ways to access a member of a value that a pointer (or iterator) points to:
it->first
or
(*it).first
Operator Priority Turns Your Expression Into
*(it.first)
first , , first. , .
std::map . vector<pair<int,string> > map<int,string>, (, ), :
map<int,string> mapper;
if(Hash(input, chordSize) != id){
mapper.push_back(make_pair(tmp, input));
}
for (map<int,string>::iterator it = mapper.begin(); it != mapper.end(); ++it)
{
cout << "1st: " << it->first << " "
<< "2nd: " << it->second << endl;
}
, , , . . , ( ), , , .