The C library function void *memchr(const void *str, int c, size_t n) searches for the first occurrence of the character c (an unsigned char) in the first n bytes of the string pointed to by the argument str.Syntax:
void *memchr(const void *str, int c, size_t n)
str -- This is the pointer to the block of memory where the search is performed.
c -- This is the value to be passed as an int, but the function performs a byte per byte search using the unsigned char conversion of this value.
n -- This is the number of bytes to be analyzed.Example:
memchr( ) function is used to locate the first occurrence of the character in the specified string.
int main ()
char string = "technicia"
ptr = (char *) memchr (string, 'h', strlen(string));
if (ptr != NULL)
printf ("character 'h' is found at " \
"position %d.\n", ptr-string+1);
printf ("character 'h' is not found.\n");
character âhâ is found at position 4
Java Enterprise Edition (EE)
Java Standard Edition (SE)
RFC (standard status)
RFC (proposed standard status)
RFC (draft standard status)
RFC (informational status)
RFC (experimental status)
RFC (best current practice status)
RFC (historic status)
RFC (unknown status)
All information of this service is derived from the free sources and is provided solely in the form of quotations.
This service provides information and interfaces solely for the familiarization (not ownership) and under the "as is" condition.
Copyright 2016 © ELTASK.COM. All rights reserved.
Site is optimized for mobile devices.
Downloads: 1591 / . Delta: 0.01624 с