© Ray Lischner 2020
R. LischnerExploring C++20https://doi.org/10.1007/978-1-4842-5961-0_15

15. The Map Data Structure

Ray Lischner1 
(1)
Ellicott City, MD, USA
 

Now that you understand the basics, it’s time to move on to more exciting challenges. Let’s write a real program—something nontrivial but still simple enough to master this early in the book. Your task is to write a program that reads words and counts the frequency of each unique word. For the sake of simplicity, a word is a string of nonspace characters separated by white space. Be aware, however, that, by this definition, words end up including punctuation characters, but we’ll worry about fixing that problem later.

This is a complicated program, touching on everything you’ve learned about ...

Get Exploring C++20: The Programmer's Introduction to C++ now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.