Hi, I need to search for a key word in last n/100 lines of a text file. Here is the code i have so far. This search whole file & that is an issue. This is not a home work question, please help.
ifstream readFile(fileName);//read the file
while( readFile >> word )
{
if ( word == badCode )
{
print("Found word %s\n", badCode);
return true;//string found
}
}