Hmm friends this is interviewer’s favourite question. Interviewer wants to know, how you handle byte stream.
Prototype of memcpy()
void *memcpy( void *to, const void *from, size_t n);
memcpy() function is used to copy the block of n bytes pointed by from to the pointed by to and it returns pointer pointed by to. But it does not take care if memory overlap means if source and destination argument overlap.
Prototype of memmove()
void *memmove( void *to, const void *from, size_t n);
memmove() function is used to copy the block of n bytes pointed by from to the pointed by to and it returns pointer pointed by to. It takes care if memory overlap, so it’s always safe to use memmove().