So I'm working on some review questions for the last chapter in my homework.
My question is, if a user inputs a string sentence, how would I go about counting the number of words? I don't think it was covered in class, or will be covered in class.
I've gotten as far as requesting the sentence and using getline to read the string, but how would I go about counting the individual words other than writing the input to a file, opening the same file, and counting the words that way?