sarahger9 0 Newbie Poster

I wrote a program that searched a file word by word, looking for keywords from another file that needed to be replaced in the first file. I did this, but I need to state an error message if one of the keyword was never found.
This is what i tried,

for (int i = 0; i < count; i++){
if (potter.eof() && (text != word)){
cout << endl << endl;
cout << word << endl;
}
}

where potter is the file is was searching, word is an array of the keywords, and text is the word from the potter file I am checking. I realize why this doesn't work, its outputting for each individual word if the keyword was not found instead of the whole text. But I am having problems fixing this.

Sorry if this was confusing, and thanks for any help.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.