2

I have just implemented the load function for dictionary, I am just confused right now as to how to check speller if my load was a success, I made the load function on a seperate file and edited the makefile and entered the command make speller and it compiled but how do I check it if is working or not and if the dictionary indeed was uploaded to my hashtable?

0

You can't trust your program output -- all it proves is that the wordcount variable is incrementing, regardless of whether the word is actually loaded.

Instead, to see what's really going on, you can use the gdb debugger to print values from your hash table:

cd ~/workspace/pset5
gdb ./speller
break load
run ./texts/austinpowers.txt

Then step through the code with n and follow along as it loads.

Use info locals to view local variables and p foo to print the value of variable foo. In this way, you should be able to inspect the contents of individual nodes of your hash table as they load.

For more help with command-line gdb, just google "cs50 gdb youtube."

1
  • still the gdb just gives me the hexadecimal addresses of heads, how do I check the linked lists individually? – Furrukh Jamal Aug 17 '16 at 8:42

You must log in to answer this question.

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