summaryrefslogtreecommitdiff
path: root/wk5/pset/speller/dictionary.c
diff options
context:
space:
mode:
authorFudgerboy <91767657+Fudgerboy@users.noreply.github.com>2024-04-28 22:09:05 +0000
committerFudgerboy <91767657+Fudgerboy@users.noreply.github.com>2024-04-28 22:09:05 +0000
commit12c1b5810fac956a374ce4a20362187f48bd7ef1 (patch)
tree045bb9d013125f34ba9338f729565769e652bc82 /wk5/pset/speller/dictionary.c
parent471a02f9042e8e8e43449b516dce9f50e8ce8140 (diff)
Sun, Apr 28, 2024, 3:09 PM -07:00
Diffstat (limited to 'wk5/pset/speller/dictionary.c')
-rw-r--r--wk5/pset/speller/dictionary.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/wk5/pset/speller/dictionary.c b/wk5/pset/speller/dictionary.c
index 16d3547..a6c4d34 100644
--- a/wk5/pset/speller/dictionary.c
+++ b/wk5/pset/speller/dictionary.c
@@ -51,12 +51,23 @@ bool load(const char *dictionary)
}
//read each word in dictionary
- char c;
- while(fscanf(source, "%s", word) != )
+ char word[LENGTH + 1];
+ while(fscanf(source, "%s", word) != "E0F")
+ {
+ malloc
+ }
/*
use fscanf(file, "%s", word) to grab words
-
+ check for ended file
+ create new node
+ use malloc
+ check if return is NULL
+ copy word from fscanf into node using strcpy
+ use hash function
+ function takes string and returns index
+ insert node into hash table
+ HOW
*/
// Close the dictionary file