0

I have finished coding the load function for pset5 dictionary.c and want to see if it works (and confirm I am on the right track) before I go onto the other functions. I tried to execute speller.c but got a permission denied error. Can anyone assist?

I note another similar question posted however it doesn't specify a particular pset5 rather asks the general question can I test part of my program.

1

Of course you can test it! In fact, you should test any section before moving on whenever possible. It's just good coding practice! You may even want to build in some extra code temporarily, just to test it. It's always best to make sure that a function is fully tested and working correctly before moving on to another, whenever possible. (Dependencies on other functions could hinder this until they too are written, tested and working, or at least have a code stub in place.)

As for the permission denied problem, it's difficult to say what is wrong without more info. If the error tells you what file is denied, go to that directory and check the permissions with the ls filename command. You can change the permissions on that file with the chmod command. If not, let us know what happened.

if you are satisfied with this answer, please mark this item as answered. Let's keep up on the forum housekeeping. ;-)

3
  • thanks for your response, I was hoping to avoid writing code to test each function due to the level of interdependency of these particular functions (unlike other psets). I was wondering whether speller.c is expected to load the dictionary correctly if load is implemented but not the other functions. Does that make sense? I shall bite the bullet and write some code for testing. Cheers. – Lulu Machete Apr 21 '15 at 4:10
  • Actually, as I recall, you can compile and run each section without having to have the later ones done. That should make your life easier. You can compile and run with load completed. As long as load will compile, you can work on it, test it and correct it's bugs before moving on. The only requirement is that you probably need to make sure it is running correctly before moving on to the next section. – Cliff B Apr 21 '15 at 4:28
  • That's what I was hoping to hear! Thanks Cliff. – Lulu Machete Apr 22 '15 at 9:23

You must log in to answer this question.

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