const void * memchr ( const void * ptr, int value, size_t num ); void * memchr ( void * ptr, int value, size_t num );
void * memchr ( const void *, int, size_t );
123456789101112131415
/* memchr example */ #include <stdio.h> #include <string.h> int main () { char * pch; char str[] = "Example string"; pch = (char*) memchr (str, 'p', strlen(str)); if (pch!=NULL) printf ("'p' found at position %d.\n", pch-str+1); else printf ("'p' not found.\n"); return 0; }
'p' found at position 5.