M
Mike Copeland
I am developing a small (and seemingly simple) STL map application,
yet I can't get a clean compile. Below is code that produces a compiler
error on the "find" call, where the compiler doesn't accept the
assignment operator for the iterator. Please advise. TIA
map<string, int> convMap;
map<string, int>::iterator kIter;
string str = "Oops";
convMap[str] = 17;
kIter = convMap.find(str) != convMap.end(); // <== error!
if(kIter != convMap.end())
{
int ppp = kIter->second;
}
else // not found
yet I can't get a clean compile. Below is code that produces a compiler
error on the "find" call, where the compiler doesn't accept the
assignment operator for the iterator. Please advise. TIA
map<string, int> convMap;
map<string, int>::iterator kIter;
string str = "Oops";
convMap[str] = 17;
kIter = convMap.find(str) != convMap.end(); // <== error!
if(kIter != convMap.end())
{
int ppp = kIter->second;
}
else // not found