#include #include using namespace std; int main() { string foo( "my cat's breath smells like catfood after it eats food."); size_t first, last; first = foo.find( "food"); last = foo.rfind( "food"); cout << "food first occurs at offset " << first << endl; cout << "food last occurs at offset " << last << endl; cout << "string::npos = " << hex << string::npos << dec << endl; first = foo.find_first_of( "food"); last = foo.find_last_of( "food"); cout << "first intersection at " << first << endl; cout << "last intersection at " << last << endl; return 0; }