splitting a string sentence into an array of strings

What would be the easiest way, if someone were to type a sentence of words into an input, to put that into an array of strings? Everything I try just doesn't seem to work.
I wouldn't use an array since you don't know how many words a sentence will contain.
Much easier to use a vector to store the words. To split the sentence you can use a stringstream, string::find and string::substring or even the old strtok function.

Topic archived. No new replies allowed.