MCPcopy Create free account
hub / github.com/Apress/beginning-cpp20 / maxWordLength

Function maxWordLength

Examples/Modules/Chapter 20/Ex20_05/Ex20_05.cpp:64–70  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

62}
63
64size_t maxWordLength(const WordCounts& wordCounts)
65{
66 size_t max{};
67 for (const auto& [word, count] : wordCounts)
68 if (count >= 2 && max < word.length()) max = word.length();
69 return max;
70}
71
72void showWordCounts(const WordCounts& wordCounts)
73{

Callers 1

showWordCountsFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected