memchr()

find character in memory block 

Function


SYNOPSIS

#include <string.h>

void *memchr(const void *s, int c, size_t n);


DESCRIPTION

The memchr() function operates as efficiently as possible on memory areas. It does not check for overflow of any receiving memory area. Specifically, the memchr() function returns a pointer to the first occurrence of c (converted to an unsigned char) in the first n bytes (each interpreted as an unsigned char) of memory area s. If c does not occur, it returns a null pointer.


PARAMETERS

s 

Points to the memory area to search.

c 

Is the character to find.

n 

Is the maximum number of bytes to search.


RETURN VALUES

If c is found in first n bytes of s, memchr() returns a pointer to the first occurrence of c; if it is not found, memchr() returns a null pointer.


CONFORMANCE

ANSI/ISO 9899-1990.


MULTITHREAD SAFETY LEVEL

MT-Safe.


PORTING ISSUES

None.


AVAILABILITY

PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Professional Developers 64-Bit Edition
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition


SEE ALSO

Functions:
memccpy(), memcmp(), memcpy(), memmove(), memset(), strchr()


PTC MKS Toolkit 10.2 Documentation Build 28.