1

I just finished implementing load() in problem set 6.
However there is still one thing I'm still not sure about: When I finish loading the dictionary file, should I return True or return the actual hash table i just obtained?
Because I still don't understand how can check() later can retrieve data from the hash table created inside load()...

2

The hash table that you've loaded the words into should be globally accessible since many functions will use it and a direct access would make things way easier.

Also, you're not supposed to alter the declaration of load and since it returns bool, you have to return a bool value. The value true should be returned in case the loading process ended with a success; otherwise, false should be returned.

5
  • I know that. But if you can't alter neither speller.c nor the declaration of these functions (load() in particular) how can we make a data structure created inside load() accessible globally? :/ am i asking for too much information? Oct 26 '14 at 2:41
  • ...can i make it global to the dictionary.c file?! I can? Can I? Oct 26 '14 at 6:38
  • @PHAMVUAnhQuan of course you can and you should!
    – kzidane
    Oct 26 '14 at 9:53
  • thank you kareem! I just never thought of the .c files in that way! For me until now they are for and only for giving definition of the functions in .h files! :P Oct 26 '14 at 13:57
  • @PHAMVUAnhQuan if this answers your question, you may upvote the answer and accept it to mark your question as solved! Thank you!
    – kzidane
    Oct 26 '14 at 16:44

You must log in to answer this question.

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