Your Browser is not longer supported

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

{{viewport.spaceProperty.prod}}

memcpy - copy bytes in memory

&pagelevel(4)&pagelevel

Syntax

#include <string.h>

void *memcpy(void *s1, const void *s2, size_t n); 

Description

memcpy() copies the first n bytes of the memory area to which s2 points into the memory
area pointed to by s1.

s1 is a pointer to the memory area to which the bytes are to be copied.

s2 is a pointer to the memory area from which the first n bytes are to be copied.

n is an integer value that specifies the number of bytes in s2 to be copied.

Return val.

Pointer to the memory area s1



successful.

Notes

This function is suitable for processing character arrays, which, in contrast to character
strings, need not be terminated by the null byte (\0).

memcpy() does not check whether data in result area s1 is in danger of being overwritten.

The behavior is undefined if memory areas overlap.

See also

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