// Demonstrating generic find algorithm with a list. #include #include #include #include #include int main() { cout << "Demonstrating generic find algorithm with " << "a list." << endl; char* s = "C++ is a better C"; int len = strlen(s); // Initialize list1 with the contents of string s. list list1(&s[0], &s[len]); // Search for the first occurrence of the letter e. list::iterator where = find(list1.begin(), list1.end(), 'e'); assert (*where == 'e' && *(++where) == 't'); }