SyntaxFix
Write A Post
Hire A Developer
Questions
A map will not keep insertion order. Use *(myMap.begin()) to get the value of the first pair (the one with the smallest key when ordered).
*(myMap.begin())
You could also do myMap.begin()->first to get the key and myMap.begin()->second to get the value.
myMap.begin()->first
myMap.begin()->second