memchr.3 (648B)
1 .TH memchr 3 2 .SH NAME 3 memchr - search for a byte in a memory block 4 .SH SYNOPSIS 5 #include <string.h> 6 7 void *memchr(const void *s, int c, size_t n) 8 .SH DESCRIPTION 9 The 10 .BR memchr () 11 function scans the first 12 .I n 13 bytes of the memory block pointed to by 14 .I s 15 for the first occurrence of the byte value 16 obtained by converting 17 .I c 18 to unsigned char. 19 Each byte in the block is treated as unsigned char. 20 .PP 21 When 22 .I n 23 is zero, the search is not performed. 24 .SH RETURN VALUE 25 The 26 .BR memchr () 27 function returns a pointer to the first matching byte, 28 or a null pointer if the byte is not found within the block. 29 .SH STANDARDS 30 ISO/IEC 9899:1999 Section 7.21.5.1