#include <stdio.h>
#include <string.h>
void *my_memcpy(void *restrict str1,const void *restrict str2,size_t n)
{
void * ret = str1;
while(n--)
{
*(char*)str1 = *(const char* restrict)str2;
str1 = (char*)str1 + 1;
str2 = (const char* restrict)str2 + 1;
}
return (ret);
}
int main()
{
char x[]="Home Sweet Home";
const char *p=&x[5];
my_memcpy(x,p,10);
printf("x=%s\np=%s",x,p);
}