I am trying to understand the function memcpy() which is defined in the C library <string.h>
Syntax: void *memcpy(void*dst,const void*src,size_t n);
I know that this function is used to copy the contents of the memory pointed by pointer src to the location pointed by the dst pointer and return a address pointed by dst pointer.
I am not able to understand the following important statement regarding memcpy():
- When using
memcpy(), memory address should not overlap, if it overlaps then thememcpy()is undefined.
Another query is:
Is the value passed to third argument of the function i.e size_t n is always an integer value?