#include <stdio.h>
char* mstrcat(char* destination, const char* source)
{
undefined
if (destination == NULL)
{
return NULL;
}
if (source == NULL)
{
return destination;
}
undefined
char* ret = destination;
undefined
while (*destination != '\0')
{
destination++;
}
undefined
while (*source != '\0')
{
*destination = *source;
destination++;
source++;
}
undefined
*destination = '\0';
return ret;
}
int main()
{
char str[lbk][rbk] = "ilove";
char str2[lbk][rbk] = "you";
char* destination = str;
char* source = str2;
char* str3 = mstrcat(destination, source);
printf("%s", str3);
return 0;
}这是我的代码,老是显示损坏

char* mstrcat(char* destination, const char* source)
{
undefined
if (destination == NULL)
{
return NULL;
}
if (source == NULL)
{
return destination;
}
undefined
char* ret = destination;
undefined
while (*destination != '\0')
{
destination++;
}
undefined
while (*source != '\0')
{
*destination = *source;
destination++;
source++;
}
undefined
*destination = '\0';
return ret;
}
int main()
{
char str[lbk][rbk] = "ilove";
char str2[lbk][rbk] = "you";
char* destination = str;
char* source = str2;
char* str3 = mstrcat(destination, source);
printf("%s", str3);
return 0;
}这是我的代码,老是显示损坏
