void * memcpy (void* destination, const void * source, size_t num);
function function:
The memory area referred to by source replicates Num bytes to the memory area referred to by destination.
function returns:
A pointer to the destination.
1 memcpy you can copy arbitrary content, such as character arrays, integers, structs, classes, and so on.
2 memcpy according to its first 3 parameters determine the length of the copy, strcpy does not need to specify a length, it encounters a string terminator " the" will end.
3 typically used when copying a string strcpy , while other types of data need to be replicated memcpy .
void* _memcpy (void *des, const void *SCR, size_t n) {void *res=des;assert (des!=null&&scr!=null);//This will void* Cast to char* type while (n--) {* ((char *) des) ++=* ((char *) SCR) + +;} return res;}
The difference between the usage of memcpy and strcpy and the realization of pure C language