#include#include int main() { std::string str = "hello world"; std::string vowels = "aeiou"; size_t pos = str.find_first_of(vowels); std::cout << "The first vowel is at position " << pos << std::endl; return 0; }
#includeIn this example, we use the `find_first_of` function to find the position of the first occurrence of the character 'l' in the string `str`. The `find_first_of` function is implemented in the `#include int main() { std::string str = "hello world"; char c = 'l'; size_t pos = str.find_first_of(c); std::cout << "The first occurrence of " << c << " is at position " << pos << std::endl; return 0; }