memccpy()

copy memory block until character is found 

Function


SYNOPSIS

#include <string.h>

void *memccpy(void *s1, const void *s2, int c, size_t n);


DESCRIPTION

The memccpy() function operates as efficiently as possible on memory areas. It does not check for overflow of any receiving memory area. Specifically, memccpy() copies bytes from memory area s2 into s1, stopping after the first occurrence of c has been copied, or after n bytes have been copied, whichever comes first.


PARAMETERS

s1 

Points to the memory area to which memccpy() copies bytes.

s2 

Points to the memory area from which memccpy() copies bytes.

c 

Represents the unsigned char that memccpy() copied. After the first occurrence of this parameter, memccpy() stops its copy operation unless n bytes were copied first.

n 

Represents the number of bytes that memccpy() copied. This operation stops after n bytes has been reached, unless c came first.


RETURN VALUES

The memccpy() function returns a pointer to the first byte after c in s1 or, if c was not found in the first n bytes of s2, it returns a null pointer.


CONFORMANCE

UNIX 98.


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:
memchr(), memcmp(), memcpy(), memmove(), memset()


PTC MKS Toolkit 10.4 Documentation Build 39.