hi guys
i made a scan function, but the compiler at uni doesn't like it, also gets only allows me to input multiple lines of code, which i need for my program, help anyone please!!!
Code:
printf("Enter the text:\n");
gets(text);
/* Extract the words from the text */
while(text[i] != '\0')
{
/* Skip over separators */
while(is_separator(text[i]))
++i;
/* It is either the end of the string or the start of a word */
/* As long as it is not the string terminator copy the character */
len = 0; /* Reset character count */
while((!is_separator(text[i])) && (text[i] != '\0'))
buffer[len++] = text[i++];
if(len>0) /* Check we have some characters in the word */
{
buffer[len] = '\0'; /* We reached the end of a word so add terminator */
addWord(buffer); /* Add the word to the list */
}
}
can any one please help me