adspace
Answer Posted / Kuldeep Garg
strcpy() is a C library function that copies the string pointed by src, including the terminating null character, into the array pointed by dest. It assumes that the destination array has enough space to store the source string plus one for the null character. On the other hand, strdup() returns a new string which is a duplicate of the original string pointed by src. It dynamically allocates memory for the new string and returns a pointer to it.
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers