I was testing my program with different texts and I found out that my code lists all words with apostrophes as misspelled, even though I have an if statement in my load function that checks for any apostrophes. Is this if statement causing the issue? Thank you in advance.

My code:

// edited out per academic honesty

You have:

else if (l == '\'' && trav->children[26] == NULL)
    trav->children[26] = calloc(1, sizeof(node));

So, what if you do have an apostrophe but trav->children[26] is not NULL?

I suggest you add another condition like:

else if (l == '\'' && trav->children[26] != NULL)
    trav = trav->children[26];
  • I added that but it didn't work. I added that statement behind the statement that checks if it is an apostrophe AND if it IS null. Is there something else I'm missing? – SuperNovaCoder Oct 28 '16 at 14:08
  • The trav = trav->children[26]; would have to be in both blocks – Blauelf Oct 28 '16 at 14:13
  • true! @@Blauelf – Ricardo David Antonetti Oct 28 '16 at 14:15

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .