Join 137,229 C++ Programmers for FREE! Get instant access to thousands of C++ experts, tutorials, code snippets, and more! There are 1,883 people online right now. Registration is fast and FREE... Join Now!
If we assume that the words are serperated by spaces then we can just tokenize the string (break it up into smaller strings seperated by the spaces) and then count the tokens. The C function strtok() would be able to do this for you.