Strings ›
word count
This function determines the number of words in a string.
Controller: nitin_ananda
Contents
Interface
C++
Word Count
| intword_count( | char* | text | ) |
- The string is null terminated
- The words seperation char is only a space and nothing else.
Example 1
#include<codecogs/strings/word_count.h> void main () { char * sz = "The quick brown fox jumps over the lazy dog."; int nWordCount = word_count (sz); printf ("The word count is %d", nWordCount); }
Output:9
Returns
- Number of words in the input string.
Authors
- Nitin Ananda
Source Code
This module is private, for owner's use only.
Not a member, then Register with CodeCogs. Already a Member, then Login.

