0

okay so i have done everything correctly in terms of getting the right results i get a correct number of misspelled words and the time is low enough. i just can't get the program to end. val grind comes back with no memory leaks. i can't figure it out. here is my code i made a trie to store the data .

[code edited out per academic honesty guidelines]

1
  • Please post your code in one block so someone can copy & compile it.
    – stensal
    Jun 18 '20 at 7:31
1

If you run valgrind, you'll see that you have hundreds of errors that all mention trying to free memory that allocated by the fopen command in load.

When you are done with that file, you need to call fclose(dic) so the file is closed properly. You called free(dic) which only freed the memory but the left the file handler in an open state. So when the program tried to exit, it ran into all sorts of memory issues.

1
  • i love you. I changed so many things trying to figure it out.
    – JISH
    Jun 18 '20 at 7:34

You must log in to answer this question.

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