memchr
Locates the first occurrence of the specified character (function or macro)
#include <string.h> void *memchr ( const void *buf, int ch, size_t length);
memchr returns a pointer to the located character or NULL if the character does not occur in the object.
The memchr function or macro locates the first occurrence of ch (converted to an unsigned char) in the first length characters of the object pointed to by buf.
#include <string.h> #include <stdio.h> main () { char *where; char buffer[80]; where = memchr (buffer, ’x’, 6); if (where == NULL) { printf ("’x’ not found\n"); } }