I have a piece of code that successfully compiles, but when I test it on my driver file, I get a "Segmentation Fault"...and nothing happens... Half of the function is ok, but then teh other half is in teh air...What am I doing wrong here...Please show me, please help
thank you in advance...so much
Code;
int checker(char *file, void (*badword)(char *))
{ char *input;
FILE *fp;
char c;
int i = 0;
int result;
char word[MAXLENGTH];
word[0]='\0';

if( (fp=fopen(file, "r")) == NULL)
return SPELL_NOTFOUND;


while( (c= getc(fp))!=EOF)
{

if (isalnum(c) == 0)
{ if(strlen(word) != 0)
{
word[i] = '\0';
i = 0;
if (check_word(word) == SPELL_INCORRECT)
{ if (badword != NULL)
badword(word);
}
word[i] = '\0';
}
}
else
word[i++] = c;

}
fclose(fp);
return SPELL_OKAY;

}