str2 = str1 simply assigns whatever address is there in str1 to str2.
memcpy and strcpy is almost the same in that it copies the contents of the memory pointed to by str2 to memory pointed to by str1. For memcpy you specify the number of bytes to be copied. strcpy on the other hand will copy all the contents till it finds a NULL character.
In you example, using strcpy or memcpy is not correct because str2 does not point...
Leave a comment: