From 757a5d508b180f5bb8e6b6251e49252f8c554a6a Mon Sep 17 00:00:00 2001 From: Fudgerboy <91767657+Fudgerboy@users.noreply.github.com> Date: Mon, 15 Apr 2024 04:22:02 +0000 Subject: Sun, Apr 14, 2024, 9:22 PM -07:00 --- wk5/pset/speller/dictionary.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'wk5/pset/speller') diff --git a/wk5/pset/speller/dictionary.c b/wk5/pset/speller/dictionary.c index 695286a..27bbeaa 100644 --- a/wk5/pset/speller/dictionary.c +++ b/wk5/pset/speller/dictionary.c @@ -54,8 +54,14 @@ unsigned int size(void) { // TODO char c; - while (fread(&c, 1, 1, )) - return 0; + while (fread(&c, 1, 1, file)) + { + if (c == "\n") + { + n++; + } + } + return n; } // Unloads dictionary from memory, returning true if successful, else false -- cgit v1.2.3