Skip to content

Commit

Permalink
a dereference to map<string, string>::iterator include a std::pair
Browse files Browse the repository at this point in the history
to write it to stdout, one needs to get its' first or second element
  • Loading branch information
asaiddd committed Jan 25, 2022
1 parent 23d65f8 commit 888db37
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Data Structures and Algorithms.md
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ unsigned int size = m.size();

// Iterate
for(std::map<std::string, std::string>::iterator it = m.begin(); it != m.end(); it++) {
std::cout << *it << std::endl;
std::cout << (*it).first << " " << (*it).second << std::endl;
}

// Remove by key
Expand Down

0 comments on commit 888db37

Please sign in to comment.