tech on the net
Home About Us Feedback Site Map


Access Excel Word


SQL Oracle / PLSQL SQL Server MySQL MariaDB PostgreSQL

Web Development

HTML CSS Color Picker


C Language


ASCII Table Linux UNIX Java Clipart Joke of the Moment

C Functions

(Scroll to see more)

Share this page:

C Language: memcpy function
(Copy Memory Block)

In the C Programming Language, the memcpy function copies n characters from the object pointed to by s2 into the object pointed to by s1. It returns a pointer to the destination.

The memcpy function may not work if the objects overlap.


The syntax for the C Language memcpy function is:

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

Parameters or Arguments

s1 is an array where s2 will be copied to.

s2 is the string to be copied.

n is the number of characters to copy.


The memcpy function returns s1.

Required Header

In the C Language, the required header for the memcpy function is:

#include <string.h>

Applies To

In the C Language, the memcpy function can be used in the following versions:

Similar Functions

Other C functions that are similar to the memcpy function: