#include<stdio.h>
#include<Windows.h>
#include<assert.h>
char *my_strcat(char *dst, const char *src)
{
assert(*dst !=NULL);
assert(*src !=NULL);
char *ret = dst;
while (*dst != '\0')
{
dst++;
}
while (*dst++ = *src++)
{
;
}
return ret;
}
int main()
{
char arr1[] = "hello";
char *arr2 = " world!";
printf("%s\n", my_strcat(arr1, arr2));
system("pause");
return 0;
}
模拟实现stract函数
最新推荐文章于 2021-10-29 19:45:07 发布