Created
September 13, 2012 07:49
-
-
Save lufehr/3712688 to your computer and use it in GitHub Desktop.
Blog - C++ std::map/multimap
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
map<string, int> m; | |
m["Hans"]=60; | |
m["Fritz"]=23; | |
m["Sepp"]=78; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
map<string,int> m; | |
map<string,int>::iterator it = m.begin(); // Zugriff auf Key | |
(*it).first | |
// oder | |
it->first // Zugriff auf Value | |
(*it).second | |
// oder | |
it->second |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
std::pair<Key,Value> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment