944,033 Members | Top Members by Rank

Ad:
  • C++ Discussion Thread
  • Unsolved
  • Views: 592
  • C++ RSS
Oct 14th, 2007
0

remark if word not found in text

Expand Post »
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.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
sarahger9 is offline Offline
12 posts
since Oct 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C++ Forum Timeline: Difficulty in utilizing functions; C2440 Error
Next Thread in C++ Forum Timeline: CDialog in userless mode?





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC