Hey all, I am resorting to posting this question after getting absolutely nowhere in four days of searching (except for maybe negative steps, got mad at my laptop and broke my delete key :( )
Anyway, my problem is that I need to separate sentences into words. I figure that the only logical way of doing this would be to use an array (and I need to for other parts of this program which I have already made)
However, I can't figure out how to gut the sentence into spaces using a loop that will pick up on the space, and put the word into one element and then start again and put the next into the next element.
So far i have tried this code, but i doubt its helpful.
Anyway, I know theres probably some errors in the formatting and spelling and stuff in that, but thats my latest concoction of how to possibly do it, I know its wrong :(
Please help, I will pray for whoever helps me tonight before i go to sleep ;)
THANKS in advanced for ANY help... but if you can give me a snippet of code it would be greatly appreciated.
Anyway, my problem is that I need to separate sentences into words. I figure that the only logical way of doing this would be to use an array (and I need to for other parts of this program which I have already made)
However, I can't figure out how to gut the sentence into spaces using a loop that will pick up on the space, and put the word into one element and then start again and put the next into the next element.
So far i have tried this code, but i doubt its helpful.
Code:
do
{
for(i=0;int(word1.length());i++)
{
nextchar=word1.at(i);//get char
if(nextchar!=' ')
{
for(i=0;i<MAX;i++)
nextchar=word[i];
}
}
}
while(nextchar!='.');
Please help, I will pray for whoever helps me tonight before i go to sleep ;)
THANKS in advanced for ANY help... but if you can give me a snippet of code it would be greatly appreciated.
Comment