#include<stdio.h>
#include<string.h>
#include<assert.h>
//常用以便签中
char* my_strcat(char* dest, char* src)
{
assert(dest && src);
char* ret = dest;
while (*dest != '\0')
{
dest++;
}
while (*dest++ = *src++);
return ret;
}
int main()
{
char arr1[30] = "Holle";
char arr2[] = "World";
my_strcat(arr1, arr2);
//arr1必须足够存放arr2
printf("arr1:\t%s", arr1);
return 0;
}
my_strcat
最新推荐文章于 2024-09-10 12:11:43 发布