gameprogcpp / code

Game Programming in C++ Code
Other
1.01k stars 354 forks source link

Typo in Appendix A: Intermediate C++ Review #41

Open zixin96 opened 3 years ago

zixin96 commented 3 years ago
// Get an iterator to the element with the key 2
std::map<int, std::string> iter = months.find(2);  // SHOULD BE std::map<int, std::string>::iterator iter = months.find(2);  
if (iter != months.end()) // This is only true if found
{
   std::cout << iter->first << std::endl; // Outputs 2
   std::cout << iter->second << std::endl; // Outputs February
}

I find this in my kindle version of the book, however, I can't seem to find page number anywhere. Thanks for the great book!