Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

memccpy - copy bytes in memory

&pagelevel(4)&pagelevel

Syntax

#include <string.h>

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

Description

memccpy() copies bytes from memory area s2 into s1 until

  • either c is copied for the first time (where c is converted to an unsigned char),

  • or n bytes have been copied.

If the copy process affects objects which overlap, the behavior is undefined.

Return val.

Pointer to the byte after the copy of c in s1



if successful..

 

Null pointer

if memalloc() was unable to provide the memory, e.g. because the available memory space was insufficient for the request.

Notes

memccpy() does not check whether there will be an overflow in the memory area to which it copies.

See also

memchr(), memcmp(), memcpy(), memset(), string.h.