0

i think the problem is with my check function.

https://pastebin.com/S7Sqq1Jj

when i test it with cats.txt,i get: WORDS MISSPELLED: 6 WORDS IN DICTIONARY: 143091 WORDS IN TEXT: 6 TIME IN load: 0.02 TIME IN check: 0.00 TIME IN size: 0.00 TIME IN unload: 0.01 TIME IN TOTAL: 0.03

but the correct output is:

MISSPELLED WORDS

WORDS MISSPELLED: 0 WORDS IN DICTIONARY: 143091 WORDS IN TEXT: 6

0

From man strcasecmp

RETURN VALUE
The strcasecmp() and strncasecmp() functions return an integer less than, equal to, or greater than zero if s1 is, after ignoring case, found to be less than, to match, or be greater than s2, respectively.

Review carefully what you have written here if(strcasecmp(cursor->word,word)==1){.

You must log in to answer this question.

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