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

Function main

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

Source from the content-addressed store, hash-verified

13void list_words(const vector<string>& words);
14
15int main()
16{
17 std::string text; // The string to be searched
18 std::cout << "Enter some text terminated by *:\n";
19 std::getline(std::cin, text, '*');
20
21 const std::string separators{ " ,;:.\"!?'\n" }; // Word delimiters
22 std::vector<std::string> words; // Words found
23
24 find_words(words, text, separators);
25 list_words(words);
26}
27
28void find_words(vector<string>& words, string_view text, string_view separators)
29{

Callers

nothing calls this directly

Calls 2

find_wordsFunction · 0.70
list_wordsFunction · 0.70

Tested by

no test coverage detected