954,505 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

remark if word not found in text

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[i])){
cout << endl << endl;
cout << word[i] << endl;
}
}
where potter is the file is was searching, word[i] 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.

sarahger9
Newbie Poster
12 posts since Oct 2007
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You