I am a little lost i am trying to find all occurrences of a string inside a string.
If I have for example

Code:
string quote = "John loves Suzy. Suzy doesnt love John. Suzy loves Grover. John does not like Grover. "
and I wanted to find all instances of the word John in the previous quote.
i think this is close but i am not sure
Code:
int position = quote.find("John", 0);
while (position != string::npos)
{
j++
}
cout << "The number of times John was used is: " << j++;
I am desperately trying to learn can anyone help?