summaryrefslogtreecommitdiff
path: root/wk5/pset/speller
diff options
context:
space:
mode:
authorFudgerboy <91767657+Fudgerboy@users.noreply.github.com>2024-04-28 23:41:16 +0000
committerFudgerboy <91767657+Fudgerboy@users.noreply.github.com>2024-04-28 23:41:16 +0000
commit534e938e3bbc6096ee856293404c67cd9e55566e (patch)
tree1e1c3b0178bcdff2d6ba123fdad3117df7d88345 /wk5/pset/speller
parent5a3bcf547b7766220bb819cccee80416c87e3e2d (diff)
Sun, Apr 28, 2024, 4:41 PM -07:00
Diffstat (limited to 'wk5/pset/speller')
-rw-r--r--wk5/pset/speller/dictionary.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/wk5/pset/speller/dictionary.c b/wk5/pset/speller/dictionary.c
index 19be3d6..3a00555 100644
--- a/wk5/pset/speller/dictionary.c
+++ b/wk5/pset/speller/dictionary.c
@@ -20,7 +20,7 @@ const unsigned int N = 26;
node *table[N];
// Size integer
-int size = 0;
+int siz = 0;
// Returns true if word is in dictionary, else false
bool check(const char *word)
@@ -69,10 +69,10 @@ bool load(const char *dictionary)
char word[LENGTH + 1];
// use fscanf(file, "%s", word) to grab words
// check for ended file
- while(fscanf(source, "%s", word) != "E0F")
+ while(fscanf(source, "%s", word) != E0F)
{
// update size int
- size++;
+ siz++;
// create new node
// use malloc
node *ptr = malloc(sizefo(node));
@@ -104,7 +104,7 @@ bool load(const char *dictionary)
// Returns number of words in dictionary if loaded, else 0 if not yet loaded
unsigned int size(void)
{
- return size;
+ return siz;
}
// Unloads dictionary from memory, returning true if successful, else false