I try to find same lines between two text files.
while (getline (texta,str1)){
while (getline (textb,str2)){
cout<<str1<<str2<<endl;
}}
First while working very well but second one just read first part line of text and then quit. I've tried different textes but doesnt work.
If you want to look all code:
void similars(string text1,string text2){
string str1,str2;
ifstream texta(text1.c_str());
ifstream textb(text2.c_str());
if(texta.is_open() && textb.is_open()){
while (getline (texta,str1)){
while (getline (textb,str2){
cout<<str1<<str2<<endl;
}
}
}
else cout << "Unable to open file";
}