memchr

This macro searches for a character in memory. The memchr macro locates the first occurrence of the character byte_value, that is contained in the first count bytes of memory area that begins with the memory location pointed to by the start variable, str1.

Syntax

char *memchr (*str1, byte_value, count)
char *str1;
char byte_value;
int count;

where:

str1                       A character pointer to the memory location of the first character byte in a string of characters contained in a file.

byte_value             A character variable used to copy the memory contents of the character occupying a specific position in a character string.

count                    An integer variable used to count the number of characters in str1 that are to be searched.

Return Value

char*                     Points to the instance of the character byte_value. If this character is not found, a NULL pointer is returned.

Rules

For debugger variables only, a value of -1 (0xFFFFFFFF) is returned, when byte_value does not occur in the memory searched by memchr.