Having my string inputted by the user. How would I find the position of the word the user entered? For example, user entered "How now cow" and they want me to find "cow" which would be position 3. I keep getting -1.
Some of my code, terribly wrong:
1 2 3 4 5 6 7 8
cout << "\nWhat piece of the string do you want to find?\n";
int look, pos;
cin >> look;
pos = input.find(look, 0);
if (pos != string::npos){
cout << look << "found !" << endl;
}