Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options answers only not deleted user 11300

speller.c is one of the files that make up Problem Set 5, but it is already written by CS50 Staff and you may not alter it! Instead, you must implement your solution by altering three other component files: dictionary.c, dictionary.h, and Makefile.

1 vote
Accepted

Unknown problem with dictionary.c Help!

compile a program that does not have main () function instead must compile speller.c, plus you have in pset5 directory a file called makefile, which will to do all the work for you, so you must do: make speller
MARS's user avatar
  • 5,179
1 vote

program control error

First error, at the end check function simply return false, you must return something, just use return in any condition IF, this causes the compiler "not know" that value is returned. we have always p …
MARS's user avatar
  • 5,179
0 votes

Loading my dictionary into a data structure speller.c/pset5

I got a runtime of 0.16 with a hash table, I certainly enjoy a lot more with a table hahs than with a trie, after solving the problem I could look for some optimizations, and I could implement my own …
MARS's user avatar
  • 5,179
0 votes

Stuck on Pset5: segmentation fault. Debug?

new_node->next=hashtable[hash(newword)]; hashtable[hash(newword)]->next=new_node Is wrong, I let you think why. The correct way would be the following new_node->next = hasht …
MARS's user avatar
  • 5,179
0 votes

Why is fscanf giving me an undefinedbehavioursanitiser error?

It seems that the route is misspelled, we can do some checks to see if the pointer is null if(dictionary == NULL) { printf("not open\n"); return 1; } The correct route is: FILE *dicti …
MARS's user avatar
  • 5,179
1 vote
Accepted

speller (hash) - check50 showing "handles substrings properly"

You have a "small" problem in check function, you actually go through the entire hash table without finding any match. What happens if strcasecmp () is zero? Why do you keep moving forward in the hash …
MARS's user avatar
  • 5,179
0 votes
Accepted

CS50 PSET5 Memory Leak (updated2)

Your error is in the statement in the function load while (unload_cursor -> next != NULL) it should be while (unload_cursor != NULL) I'll let you think why
MARS's user avatar
  • 5,179
1 vote

cs50 pset 5 SPELLER load help segmentation fault

hashtable[hashval]->next = new_node; Is causing segmentation failure. The correct statement is new_node->next = hashtable[hashval]; hashtable[hashval] = new_node; in the other hand if(hashtable[ …
MARS's user avatar
  • 5,179
1 vote
Accepted

Problem Set 4 Valgrind

The problem is in the declarations: char *checkword = malloc(sizeof(LENGTH + 1)); and i < strlen(word) + 1; Note that the length of the word array is LENGTH + 1, then the length of strlen (word) …
MARS's user avatar
  • 5,179
0 votes
Accepted

CS50 Speller (hash table) - Check returning 0 misspelled words

return copyindex; The return statement has two important uses. First, the one that matters here, forces an immediate exit from the function in which it finds itself. That is, it causes the execution …
MARS's user avatar
  • 5,179
4 votes
Accepted

Pset5 Memory leak in unload()

Complicated code in terms of memory management. This set of problems deals with the traditionally more difficult concepts of C programming, so we need a good theoretical basis for dealing with them. W …
MARS's user avatar
  • 5,179