New answers tagged

1 vote
Accepted

PS5 speller memory trouble

The actual valgrid problem is a logic error. Look at the tail end code of load(): fclose(dict_file); return true; } free(word_temp); } This free statement will never execute ...
user avatar
  • 63.5k
1 vote

PS5 speller memory trouble

At least one problem is this char *word_temp = malloc(sizeof(LENGTH + 2));. LENGTH + 2 is an int, sizeof(int) is 4.
user avatar
1 vote
Accepted

Speller Error - free(): double free detected in tcache 2 Aborted (core dumped)

The fail occurs in unload, but the error lies in load. Look at this code: if (table[index] == NULL) { table[index] = n; } n->next = table[index]; table[index] = n; ...
user avatar
  • 63.5k
0 votes

Speller program memory leaks

You forgot to close the file. fopen works just as malloc does, you have to to free the file from memory manually after you're done with it.
user avatar
1 vote
Accepted

PSET5 Speller: Check50 Can't Compile: Exit code 2 vs 0

This is one of those rare circumstances where check50 actually is broken. Seems that a bug was introduced with the latest update. It's being rolled back as I type, and may well be working again as ...
user avatar
  • 63.5k
0 votes

PSET5 Speller: Check50 Can't Compile: Exit code 2 vs 0

I had the same issue and I think that this is a a bug on CS50's end. check50 seems to work 1/10 of the time. check50 worked the first time I ran it on speller but it stopped working after that.
user avatar
1 vote

PSET5 Speller: Check50 Can't Compile: Exit code 2 vs 0

been getting the same error since I started optimizing my solution today. Was working fine till today. Think this is a bug in check50.
user avatar
  • 11
1 vote
Accepted

Speller pset 5 my code is not working for substrings

Actually, it's not working with a lot more than that. Since check50 is using very small test data lots, it's actually not seeing the underlying problem in other tests. This is a good lesson in why ...
user avatar
  • 63.5k

Top 50 recent answers are included