Hey guys, I am using the code below ot search for words in a text file and count them. I now would like to do something a little more advanced for example if a text file contains
"hello my name is kim" I want to be able to increment a variable everytime the words hello and my appear next to eachother, is there an easy way to do this?
Thanks.
char array [200];
ifstream file;
while (file >> array)
{
if(strstr(array,"test") != 0)
test++;
}