| 13 | void list_words(const vector<string>& words); |
| 14 | |
| 15 | int 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 | |
| 28 | void find_words(vector<string>& words, string_view text, string_view separators) |
| 29 | { |
nothing calls this directly
no test coverage detected