| Summary | |
| Description | The strpbrk function searches string for the first occurrence of any character from set. The null terminator is not included in the search. |
| Return Value | The strpbrk function returns a pointer to the matching character in string. If string contains no characters from set, a null pointer is returned. |
| See Also | strchr, strcspn, strpos, strrchr, strrpbrk, strrpos, strspn |
| Example |
#include <string.h>
#include <stdio.h> /* for printf */
void tst_strpbrk (void)
{
char vowels [] ="AEIOUaeiou";
char text [] = "Seven years ago...";
char *p;
p = strpbrk (text, vowels);
if (p == NULL)
printf ("No vowels found in %s\n", text);
else
printf ("Found a vowel at %s\n", p);
}
|