Skip to content

Commit 888db37

Browse files
committed
a dereference to map<string, string>::iterator include a std::pair
to write it to stdout, one needs to get its' first or second element
1 parent 23d65f8 commit 888db37

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Data Structures and Algorithms.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ unsigned int size = m.size();
300300

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

306306
// Remove by key

0 commit comments

Comments
 (0)