---
name: "memcpy"
section: "3"
platform: "macos"
package: "Libc"
version: "1752.120.2"
release: "macOS 26.5"
platforms: ["linux", "freebsd", "macos"]
url: "https://new.carta.tech/memcpy"
---

# memcpy(3)

copy memory area

## NAME

**memcpy** – copy memory area

## LIBRARY

Standard C Library (libc, -lc)

## SYNOPSIS

**#include \<string.h\>**

*void* *\**\

**memcpy**(*void \*restrict dst*, *const void \*restrict src*, *size\_t n*);

## DESCRIPTION

The **memcpy**() function copies *n* bytes from memory area *src* to memory area *dst*. If  *dst* and  *src* overlap, behavior is undefined. Applications in which *dst* and  *src* might overlap should use [memmove(3)](/memmove/3.md) instead.

## RETURN VALUES

The **memcpy**() function returns the original value of *dst*.

## SEE ALSO

[bcopy(3)](/bcopy/3.md), [memccpy(3)](/memccpy/3.md), [memmove(3)](/memmove/3.md), [strcpy(3)](/strcpy/3.md), [wmemcpy(3)](/wmemcpy/3.md)

## STANDARDS

The **memcpy**() function conforms to ISO/IEC 9899:1990 (“ISO C90”).
