Strcpy is use for copying only string from source to destination character buffer including NULL character also, whereas memcpy is used to copy any data type (void *) from source to destination , and the number of bytes copied from source to destination will be specified as the third argument of memcopy function.
If a buffer contains more than one NULL pointer, in that case we can't use strcpy but we can use memcpy because strcpy will stop after first NULL character .
Strcpy is use for copying only string from source to destination character buffer including NULL character also, whereas memcpy is used to copy any data type (void *) from source to destination , and the number of bytes copied from source to destination will be specified as the third argument of memcopy function.
ReplyDeleteIf a buffer contains more than one NULL pointer, in that case we can't use strcpy but we can use memcpy because strcpy will stop after first NULL character .