Correct me if I'm wrong but why does the rfind function display 8? Isn't 4 supposed to be displayed? Start counting backwards from 0 to 4? Spam will be found int the sentence "This is spam!".
1 2 3 4 5
string s2("This is spam!");
// rfind is the reverse find
// counts right to left
cout << s2.rfind("spam") << endl; // Displays 8
// Starts counting index backwards from 0