The C/C++ standard library function strcpy, copies a null-terminated string to a destination string. It also makes sure that the destination string is null-terminated. Here is a custom implementation of strcpy:
char* mstrcpy(char* dest, const char* src) {
while(*src)
*dest++ = *src++;
return dest;
}
Do you think mstrcpy would work as expected? Select appropriate choice below to tell what could be wrong with mstrcpy implementation: