Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
zixin96 opened this issue Jan 27, 2021 · 0 comments
Open

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

zixin96 opened this issue Jan 27, 2021 · 0 comments

Comments

@zixin96
Copy link

zixin96 commented Jan 27, 2021

// 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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant