0

Here is my code for the pset

I am getting 2 errors after check50. I am not able to get hold of any loopholes in the code. Kindly help!

1) :( handles max length (45-char) words

expected "MISSPELLED WOR...", not "MISSPELLED WOR..."
Log
running ./speller max_length/dict max_length/text...
checking for output "MISSPELLED WORDS\n\n\nWORDS MISSPELLED: 0\nWORDS IN DICTIONARY: 1\nWORDS IN TEXT: 1\n"...
Expected Output:
MISSPELLED WORDS

WORDS MISSPELLED:     0
WORDS IN DICTIONARY:  1
WORDS IN TEXT:        1
Actual Output:
MISSPELLED WORDS

pneumonoultramicroscopicsilicovolcanoconiosis
WORDS MISSPELLED:     1
WORDS IN DICTIONARY:  1
WORDS IN TEXT:        1

Apparently its shows that the word is in the dictionary but still is misspelt.

2) :( program is free of memory errors

I ran help50 on valgrind; it gives:

==23154== Conditional jump or move depends on uninitialised value(s)

Looks like you're trying to use a variable that might not have a value? Take a closer look at line 107 of dictionary.c.

1 Answer 1

1

This line for (int i = 0; i < LENGTH; i++) is indicated in both problems. The loop only processes 45 bytes (index 0 through 44). This word pneumonoultramicroscopicsilicovolcanoconiosis takes up 46 bytes

What's the thing that makes a string a string? It is the terminating null-byte. lowerCaseWord doesn't have one.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .