#include<string.h>
#include<stdio.h>
#include<assert.h>
char* my_strcat(char* arr1, const char* arr2)
{
assert(arr1 && arr2 != NULL);
while (*arr1 != '\0') //找到arr1的\0
{
arr1++;
}
while (*arr1++ = *arr2++)
{
;
}
return arr1;
}
int main()
{
char arr1[30] = { "abc" };
char arr2[] = { "def" };
my_strcat(arr1,arr2);
printf("%s", arr1);
return 0;
}