const char * strpbrk ( const char * str1, const char * str2 ); char * strpbrk ( char * str1, const char * str2 );
char * strpbrk ( const char *, const char * );
12345678910111213141516171819
/* strpbrk example */ #include <stdio.h> #include <string.h> int main () { char str[] = "This is a sample string"; char key[] = "aeiou"; char * pch; printf ("Vowels in '%s': ",str); pch = strpbrk (str, key); while (pch != NULL) { printf ("%c " , *pch); pch = strpbrk (pch+1,key); } printf ("\n"); return 0; }
Vowels in 'This is a sample string': i i a a e i