Can u please tell me the difference between strcpy() and memcpy().
can you tell the diff between strcpy and memcpy?
Collapse
X
-
Tags: None
-
strcpy() copies bytes until it reaches a 0 byte.
memcpy() copies memory based on the size argument regarless of contents. -
Hello,
Another less obvious but often overlooked difference is,
strcpy() - The strings may not overlap, and the destination string dest must be large enough to receive the copy.
memcpy()- If copying takes place between objects that overlap, the behaviour is undefined.
(P.S. - This problem ate up my whole day to figure it out)Comment
Comment