Originally Posted by
TheLions
Can you please elaborate how to do that?
I spent 3 hours messing with scanf and loops and I didn't succeeded.
i dont have the time to make a ready to go script but ill give you a rough example
Code:
for ( /* get char with fgetc and save it // in for *** long as not = \n )
{
if (this is a alphabetical char or number)
{
if (!inword)
{
j++; // start a new word
}
// save the char in a array[j][i] = c
}
else if (inword)
{
inword = false;
// append \0 to the current string// array[j][i] = '\0'
}
else
{
// just discard this char // dont do i++
}
}
hope it will help
google fgetc that might help aswell
Bookmarks