I'm trying to create a program to read words for a file(word1.txt) and check against a dictionary (wordlist.txt) and output the number of words which match (i.e. are words). The dictionary file is formatted with each word on a new line. But the program isn't working as it only says that 1 word is ever valid however many actually valid words there are.
dict >> b reads the next line everytime it is called, but what happens when you reached the end of the file? it tries to start read from the end of the file. so no words are checked...