Hello my check function keeps returning false for all of the words. I ran it through gdb:

Some prints i did in gdb

print thisNode
(node *) 0x804c170
print thisNode->word
$2 = "elephant\n", '\000' <repeats 36 times>`
(gdb) print thisNode->next
$3 = (struct node *) 0x0
print hashIndex
$1 = 4
print hashTable[hashIndex]
$2 = (node *) 0x804c170
print hashTable[hashIndex][0]
$3 = {word = "elephant\n", '\000' <repeats 36 times>, next = 0x0}

And my check function has this:

[mod: code removed from view]

1 Answer 1

print thisNode->word
$2 = "elephant\n"

Looks like you are including the new line char in your word. This will cause all of the words to be misspelled, as the word sent to check will, of course, not include the newline.

Revisit your load function and make sure you don't include the newline.

  • Ah thank you :)
    – user7869
    Aug 19, 2015 at 1:40

You must log in to answer this question.

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