photonchaser
n00b
- Joined
- Sep 23, 2004
- Messages
- 15
Code:
inword = FALSE;
while((c = getchar())!= EOF)
{
if(c == '\n')
{
line++;
}
if(!inword && !isDelimit(c))
{
inword = TRUE;
}
else if(inword && isDelimit(c))
{
inword = FALSE;
}
if(inword)
{
word[i] = c;
i++;
}
}
"This is an apple". This codes suppose to read the word "This" to an array word. I have to do something with the array before move on to the next word on the line. But I traced this code and it copy the entire line without spaces. I print the array out and it looks like this Thisisanapple. Which is not the point. Can anyone help?