welibc
A clear, secure, and well documented standard C library
Functions
memcpy.c File Reference

Defines the memcpy function. More...

#include <string.h>
Include dependency graph for memcpy.c:

Go to the source code of this file.

Functions

void * memcpy (void *s1, const void *s2, size_t n)
 Copies n characters from s2 into s1. More...
 

Detailed Description

Defines the memcpy function.

Definition in file memcpy.c.

Function Documentation

◆ memcpy()

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

Copies n characters from s2 into s1.

Parameters
*s1The destination location to which to copy characters
*s2The source location from which to copy characters
nThe number of characters to copy

The memcpy function copies n characters from the object pointed to by s2 into the object pointed to by s1.

Note
Copying between overlapping objects is supported, but the source may be overwritten.
Warning
If copying is attempted such that a memory read/write will wrap, the copy will not take place.
See also
memmove()
Returns
The value of s1

Definition at line 60 of file memcpy.c.

References memmove().

Here is the call graph for this function: