From c2506942fdfd43c779c15b23c7ba3afdcc216d6b Mon Sep 17 00:00:00 2001 From: Fudgerboy <91767657+Fudgerboy@users.noreply.github.com> Date: Sun, 14 Apr 2024 23:48:21 +0000 Subject: Sun, Apr 14, 2024, 4:48 PM -07:00 --- wk5/pset/speller/dictionary.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'wk5/pset/speller/dictionary.c') diff --git a/wk5/pset/speller/dictionary.c b/wk5/pset/speller/dictionary.c index 509844d..8625d73 100644 --- a/wk5/pset/speller/dictionary.c +++ b/wk5/pset/speller/dictionary.c @@ -36,7 +36,15 @@ unsigned int hash(const char *word) bool load(const char *dictionary) { // TODO - return fopen(dictionary, "r"); + FILE *file = fopen(dictionary, "r"); + if (file != NULL) + { + return true; + } + else + { + return false; + } } // Returns number of words in dictionary if loaded, else 0 if not yet loaded -- cgit v1.2.3