I have to write a program that checks the spelling of all words in a file. It should read each word of a file and check whether it is contained in a word list. Use the file /usr/share/dict/words. The program should print out all words that it cannot find in the word list. Follow this pseudocode:
Open the dictionary file.
Define a vector of strings called words.
For each word in the dictionary file
Append the word to the words vector.
Open the file to be checked.
For each word in that file
If the word is not contained in the words vector
Print the word
If anyone could help I would greatly appreciate. I have NO idea what to do!
How do I even define a vector of string called words? I put a sentence of words (some mispelled) in another file so I could compare the dictionary with the sentences of words I made up so I could compare both files and there would be some words in the dictionary and some not.