New answers tagged speller
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 ...
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.
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;
...
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.
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 ...
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.
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.
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 ...
Top 50 recent answers are included
Related Tags
speller × 845pset5 × 609
load × 149
valgrind × 94
dictionary × 93
check × 77
trie × 71
cs50x × 67
pset4 × 52
segmentation-fault × 51
unload × 50
check50 × 45
hash-table × 44
c × 27
pset6 × 23
memory-leak × 22
speller-check × 20
memory × 17
hash-function × 17
segfault × 15
misspelling × 13
pointers × 12
error × 11
fails-check50-but-works × 9
malloc × 9