Table of Contents        Previous topic       Next topic       

C COMPILER LIBRARY FUNCTION REFERENCE->Detailed Descriptions->memchr()


#include <string.h>

char *memchr(void *buf,int c, size_t count);Find character in a buffer


bufPointer to buffer
cCharacter to find
countNumber of characters to search


This function looks for the first occurrence of c in the first count bytes of buf

It returns when it has found c or when it has searched count bytes.

Return Value

If successful, the function returns a pointer to the first occurrence of c in buf.  Otherwise it returns NULL.