From 0dca0589c450a4d6605f6cb37e7e13feccbb4c7d Mon Sep 17 00:00:00 2001 From: Fudgerboy <91767657+Fudgerboy@users.noreply.github.com> Date: Sun, 28 Apr 2024 22:20:44 +0000 Subject: Sun, Apr 28, 2024, 3:20 PM -07:00 --- wk5/pset/speller/dictionary.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'wk5/pset/speller') 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 -- cgit v1.2.3