I'm getting an infinite loop. My code seems right to me so I can't figure out how to fix the infinite loop
A file name is passed to the function. The point of the function is to cout all of the words in string filename that don't appear in my dictionary files "A.txt, B.txt, etc"
You should probably check whether "din" successfully opened.
If it didn't, it's failbit will be set, meaning its eof bit won't be set and your while loop keeps going as a result.