From 888db372c91e3cfd2a11c72f060ad95bcf95bd1e Mon Sep 17 00:00:00 2001 From: asaiddd Date: Tue, 25 Jan 2022 23:48:43 +0300 Subject: [PATCH] a dereference to map::iterator include a std::pair to write it to stdout, one needs to get its' first or second element --- Data Structures and Algorithms.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Data Structures and Algorithms.md b/Data Structures and Algorithms.md index 68c0426..c8c78ea 100644 --- a/Data Structures and Algorithms.md +++ b/Data Structures and Algorithms.md @@ -300,7 +300,7 @@ unsigned int size = m.size(); // Iterate for(std::map::iterator it = m.begin(); it != m.end(); it++) { - std::cout << *it << std::endl; + std::cout << (*it).first << " " << (*it).second << std::endl; } // Remove by key