can map return a value to a variable in c++
#include <iostream>
#include <map>
using namespace std;
int main(void) {
map<char, int> m = {
{'a', 100},
{'b', 200},
{'c', 300},
{'d', 400},
{'e', 500},
};
auto it = m.find('e');
if ( it == m.end() ) {
// not found
cout<<"Element not found";
}
else {
// found
cout << "Iterator points to " << it->first << " = " << it->second << endl;
}
return 0;
}