I wrote my input with files, so as to save time (I just copy paste the input to a file and run the program - which outputs me to a file - I copy paste it ) I have several problems -
the fprintf() function outputs me each word on it's own line - does anyone know how to make all the words comeout in the same line??
When I input the words (cpy/paste from the site) I have "# " before each word. This is what I tried for solving it, but it still gives me a bad output.
- Code: Select all
void get_word(char* word)
{
int len=strlen(word),cnt=0,i,j;
char word1*;
while (!((*word<'=Z)'&&(*word=>'A')||((*word=<'z')&&(*word=>'a')))
{
cnt++;
word++;
}
word1=(char*)calloc(len-cnt+1,sizeof(char));
for (i=cnt;i<=len;i++)
word1[i-cnt]=word[i];
free(word);
word=(char*)calloc(strlen(word1)+1,sizeof(char));
strcpy(word,word1);
free (word1);
}