word count

I am trying to count words in a simple sentence.Like
Little Red Riding Hood.

can someone show me how

thank you
How about counting the spaces between words and adding 1? std::string::find and a while loop might be useful. :)
http://cplusplus.com/reference/string/string/find/

-Albatross
Topic archived. No new replies allowed.