View previous topic :: View next topic
|
Author |
Message |
sreddy
New User
Joined: 16 Mar 2005 Posts: 8 Location: Bangalore
|
|
|
|
Hi
Can any one suggest the logic for a program to find word count,
EX:
Text is : we are mainframe guys
output No words: 4 |
|
Back to top |
|
|
Piyu
New User
Joined: 12 Apr 2006 Posts: 3 Location: Washington DC
|
|
Back to top |
|
|
acp_ajay1
New User
Joined: 13 Mar 2006 Posts: 9
|
|
|
|
Hi sreddy,
U can also take a variable of type char of length 1 and extract one by one all the characters of the string and check whether the character is space or not. Since u know the total length it should not be a problem for u.
This method is ok if u just want to count the number of words but if u want to store them separately then i suggest u go for the unstring method.
Hope this was helpful.
Regards,
Ajay |
|
Back to top |
|
|
|