Pretty simple to code this up, why not try?
while there are more letters in the string
take each letter and put it into a char words[50][50], incrementing j,
unless it's a space or punctuation char. (use ctype.h and isalnum() ).
In that case, increment i and start a new word[i][j] at the next isalnum()
char.
end of while
You know this is painful to not give out code! I always wanted to be a God. ;)
You wouldn't learn much that way, though. Doesn't take a God to figure that out.
Adak
Nearly a Posting Virtuoso
1,479 posts since Jun 2008
Reputation Points: 425
Solved Threads: 185
By default, operations such as scanf split on whitespace. All that remains is to be able to not overflow buffers and to recognize when the stream has reached an invalid (or empty) state. What exactly are you having trouble with?
L7Sqr
Practically a Master Poster
657 posts since Feb 2011
Reputation Points: 201
Solved Threads: 124