|
-
May 6th, 2008, 04:04 PM
#1
loop issues
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;
}
}
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|