remark if word not found in text

Please support our C++ advertiser: Intel Parallel Studio Home
Reply

Join Date: Oct 2007
Posts: 12
Reputation: sarahger9 is an unknown quantity at this point 
Solved Threads: 0
sarahger9 sarahger9 is offline Offline
Newbie Poster

remark if word not found in text

 
0
  #1
Oct 14th, 2007
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.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC