Please, I need your help. I have dependency issue with my code. This is check50 response on my code.
tionary.c, dictionary I guess the problem is with my load function.h After a few tweaks on the code to fix the dependency issue, Makefile exist
Checks
0 Checking for file dictionary.c. ..the load function refused to load. I have spent much time on it but received no such file!
speller compiles
! Fixcould not understand what the following dependencies first:
dictionaryproblem is.c Below is a snippet of the code. Debug50 is of no use, as it just says "could not load dictionary/large".h Do please, Makefile exist
handles most basic words properly
! Fix the following dependencies first:
speller compiles
handles min length (1-char) words
! Fix the following dependencies first:
speller compiles
handles max length lend some advice.
int word_count = 0;
bool load(45-charconst char *dictionary) words
! Fix the following dependencies first:
speller compiles
spell-checking is case-insensitive
! Fix the following dependencies first:
speller compiles
handles possessives properly
! Fix the following dependencies first:
speller compiles
handles substrings properly
! Fix the following dependencies first:{
inptr = fopen ("dictionary", "r+");
if (inptr == NULL)
{
return false;
printf ("Could not open dictionary\n");
fclose(inptr);
}
node* root = calloc(1, sizeof(node));
node* pecker = root;
while (!&feof)
{
c = fgetc(inptr);
if (c == '\n')
{
pecker -> is_word = true;
pecker = root;
index = 0;
}
if (isalpha(c))
{
tolower(c);
index = (c - 'a');
}
while ((pecker -> branches[index]) == NULL)
{
pecker = calloc (1, sizeof(node));
pecker = pecker -> branches[index];
}
if (c == '\'')
{
index = 26;
if (pecker -> branches[index] == NULL)
{
pecker = calloc (1, sizeof(node));
pecker = pecker -> branches[index];
}
else if (pecker -> branches[index] != NULL)
{
pecker = pecker -> branches[index];
}
}
FILE* outptr;
outptr = fopen ("dictionary", "w+");
if (outptr != NULL)
{
fclose (outptr);
}
else if (outptr == NULL)
{
fputc (c, outptr);
}
word_count++;
if (&feof)
{
fclose(inptr);
}
}
return false;
}