i want to go threw a list of words and find if there is a string thats equal to another list. But my loop only finds one word of the four that it should. any help would be much appriciated.
ifstream fin;
fin.open ( "Wordlist.txt" );
ifstream fin2;
fin2.open ( "Words.txt" );
string line;
string line2;
while ( getline ( fin2, line2 ) )
{
while ( getline ( fin, line ) )
{
if ( line == line2 )
{
cout << "Found word that matched: " << line << endl;
}
}
}
