#include <iostream>
#include <fstream>
#include <string>
using std::cout;
using std::endl;
int main()
{
std::ifstream ifs("d:\\data.txt");
char s[80], word[] = "c++";
bool found = false;
while (!ifs.eof()) {
ifs >> s;
if (!strcmp(s, word)) {
found = true;
break;
}
}
ifs.close();
if (found)
cout << "found" << endl;
else
cout << "not found" << endl;
return 0;
}
/*
run:
found
*/