I cannot figure this out, i have a program that opens a text file and searches for the word to find and it does all that but it doesnt show how many instances of the word are in there.
= has higher precedence than != so line 71 is seen as while(position = (storeText.find(strFind, position) != string::npos))
by the compiler. To fix this you have to put parentheses around the assignment. while((position = storeText.find(strFind, position)) != string::npos)