Please help me!

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!

Thanks :)
What are you having problems with? This is a pretty well laid out problem, just run down the list doing each task until you're done. This link will help:

http://www.cplusplus.com/reference/string/string/compare/

EDIT:
On a side note, I had no idea that directory existed. I just learned something, I may have some fun with this...
Last edited on
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.
std::vector<std::string> words;

Have you used std::vector before?
Umm.. Yeah that looks relatively familiar. I'm sorry, I am really bad at this stuff!
Topic archived. No new replies allowed.