Starting out with C++ Chapter 12 Programming Challenge 19 Write a function vertor split(string str) that takes a string as parameter and returns a vector of the distinct words in the string. A distinct word is any run of characters delimited by the beginning of the string, the end of the string, or whitespace. A consecutive run of whitespace characters is to be treated the same as a single whitespace character. Test your program by having the user enter lines of input, reading and splitting the line into words, and printing the words in the returned vector with each word on its own line. For example, the input Every good boy does fine. results in the output: Every good boy does fine.
Starting out with C++ Chapter 12
Write a function vertor<string> split(string str) that takes a string as parameter and returns a
Every good boy does fine.
results in the output:
Every
good
boy
does
fine.
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 3 images