Hello,

I have a program that i need to input a sentences from file and do with them some thing.

I inputed it by fgets fun, and saved them at array.

Now i want to cut the every sentence to words, such is:
these sentences:
Hello world You need to write some woRm words.
This is an Example.
Hello, how are you today?
This is a shining sword that belongs to the wordy swordsmanS.

if I want to get every word in the sentence and save them (for example in array), like this (for the first line):
Hello
world
You
need
to
write
some
woRm
words.

how can I do this ?

If you know what you're doing with *scanf , the its %s directive (which is whitespace delimited) makes this dead easy. For your best results, post code when you want help with code (and please use code tags).

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.