Hey guys, I now want to make a program to count simple integers my first problem is that the following code will also count the word hint as an int. I was wondering if there is an easy way round this problem? (I tried putting whitespace after the word like "test " although that didn't work either)
I am aware of the other problems when counting ints such as if one is declared like int j,k,l; and int functions but I can solve the int j,k,l; with a loop although im not sure about the int functions.
char array [200];
ifstream file;
while (file >> array)
{
if(strstr(array,"test") != 0)
test++;
}