std::unordered_map<std::string,double>::const_iterator got = mymap.find (input); if ( got == mymap.end() ) std::cout << "not found"; else std::cout << got->first << " is " << got->second;