Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <map>
- using namespace std;
- int main() {
- map<int, string> m = {{1, "Geeks"},
- {2, "For"}, {3, "Geeks"}};
- auto it = m.find(0);
- //map<int, string>::iterator it = m.find(0);
- if (it != m.end())
- cout << it->first << " " << it->second;
- else cout << "Key not Found!";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment