0

So my code does compiles but it does print all the words as mispelled plus now i have a segmentation fault. Please i need so hints.

here my codes :

https://pastebin.com/4axfif3g

1

Unclear what this is meant to do in load How would pointer->is_word already be true? Shouldn't your load be setting it to true when you reach the end of the word?

//if newline means end of word in dictionary reached
        else if (pointer->is_word)
        return true;
| improve this answer | |
  • at first i was doing pointer-> until end of the word is reached, but then i had some advice to use in the define struc bool is_word, which he explains to me that in that struct for a trie, some node where is_word, if so, it was the end of the word. at first my struct was char * word[LENGHT +1] but than i didn t how to put the end of the word. pointer-> should be \0 right ? but the compiler didnt accept it. I am also confused between the end of a word in dictionary and in the text ?! load vs check. tks – Genevie Sep 3 '17 at 16:19
  • here my code before i switch the is_word : pastebin.com/6tcUBq4z – Genevie Sep 3 '17 at 16:24
  • I think you've misunderstood my answer. In load, you need to actually set the value for is_word to true, not check if it is true. – curiouskiwi Sep 4 '17 at 1:01

You must log in to answer this question.

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