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

Function list_words

Examples/NoModules/Chapter 09/Ex9_02.cpp:44–55  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

42}
43
44void list_words(const vector<string>& words)
45{
46 std::cout << "Your string contains the following " << words.size() << " words:\n";
47 size_t count{}; // Number of outputted words
48 for (const auto& word : words)
49 {
50 std::cout << std::format("{:>15}", word);
51 if (!(++count % 5))
52 std::cout << std::endl;
53 }
54 std::cout << std::endl;
55}

Callers 1

mainFunction · 0.70

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected