No match for ‘operator=’


i am trying to give ch a string value from a map with the find() function but its giving me an error(no match for ‘operator=’). how can i fix that?

Find returns an iterator not a value. Dereference the iterator with *. You should probably make sure the iter is not m.end() first though. If you know the key exists just assign directly with ch = m[v[i]]