I have a problem with my program, which is used to segment a text file to display keywords and store them in another file,
assume that "my_text.txt" file contains all the words of my text, separated with a newline, and "empty_words.txt" file containing all the empty words like (to, they, as well, .. etc..), my problem is that i want to compare the words of the two files to extract the words that are not empty(keywords).
when I run my program, it shows me only the first word repeated several times.
thanks so much for helping me to solve this problem and this is a little code I wrote
string newContent;
string emptyWordsContent;
ifstream newText("my_text.txt",ios::in);
ifstream emptyWords("empty_words.txt", ios::in);
ofstream finalText("final_text.txt",ios::out);
while ( std::getline(newText, newContent)){
while(std::getline(emptyWords, emptyWordsContent)){
if(newContent!=emptyWordsContent){
finalText<<newContent<<endl;
}
}
}