New answers tagged

0 votes

I hope CS50 community can help why I got expected exit code 0, not 1

When there is an Exception, you want to return the exception, so your code can handle it properly. You don't want to return None; that is meaningless to the calling function. Google try/except/raise. ...
user avatar
  • 142
0 votes

PSET5 unload error

I can't explain why it fails the other tests when that code is included, but the errors in unload() are easy. Look at the following: if (cursor2 == NULL) { cursor2 = cursor2->next; If ...
user avatar
  • 63.1k
0 votes

CS50 Pset5 Help

Simple. What happens when a word only has one letter, like "a" - the first word in the dictionary? ;-) Also, the hash function can go out of range. The limit on table[] is 26 x 26. The ...
user avatar
  • 63.1k
0 votes

Speller returning 'a' or 'A' as misspelled 500+ times

Thanks for the help. I fixed those errors, the one that seemed to be causing the bug though was that I needed to change "if (strcasecmp(currentWord, Word))" to "if (strcasecmp(...
user avatar
0 votes

Speller returning 'a' or 'A' as misspelled 500+ times

I see a couple of problems. First, the hash function can return any number without limit. How many elements are in table[ ]? What happens if the hash function returns a number outside that range? ...
user avatar
  • 63.1k
0 votes

PS5 - Back to the Bank - check50 - expected exit code 0, not 1

This has been discussed on the CS50 ED Discussion Forums. Have you reviewed them? The first check is running your tests against their test "correct version" of bank.py (not your version). So,...
user avatar
  • 142

Top 50 recent answers are included