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

Function list_words

Examples/Modules/Chapter 08/Ex8_08.cpp:41–52  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 1

mainFunction · 0.70

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected