summaryrefslogtreecommitdiff
path: root/wk5/pset/speller
diff options
context:
space:
mode:
authorFudgerboy <91767657+Fudgerboy@users.noreply.github.com>2024-04-28 22:20:44 +0000
committerFudgerboy <91767657+Fudgerboy@users.noreply.github.com>2024-04-28 22:20:44 +0000
commit0dca0589c450a4d6605f6cb37e7e13feccbb4c7d (patch)
tree99f55a763779ab9bf270f45a698329b891c108d7 /wk5/pset/speller
parentab6d7b65a1d47c4a6d752090c25bb6e98f81e426 (diff)
Sun, Apr 28, 2024, 3:20 PM -07:00
Diffstat (limited to 'wk5/pset/speller')
-rw-r--r--wk5/pset/speller/dictionary.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/wk5/pset/speller/dictionary.c b/wk5/pset/speller/dictionary.c
index acaa300..b89d246 100644
--- a/wk5/pset/speller/dictionary.c
+++ b/wk5/pset/speller/dictionary.c
@@ -52,21 +52,22 @@ bool load(const char *dictionary)
//read each word in dictionary
char word[LENGTH + 1];
+ // use fscanf(file, "%s", word) to grab words
+ // check for ended file
while(fscanf(source, "%s", word) != "E0F")
{
+ // create new node
char *ptr = malloc(sizefo(node));
if (ptr == NULL)
{
fclose(source);
return false;
}
-
+ strcpy()
}
/*
- 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