“memcpy” in the “string” header file can copy the contents in memory.
And here is a simple example in C++.
#include<iostream>
#include<cstring>
//One example of the use of "memcpy".
int main()
{
char a[15];
char b[15]="Hello world!";
memcpy(a,b,strlen(b));
printf("%s",a);
return 0;
}