char* strcat(char* dest,const char* src)
{
char* ret;
ret = dest; //保存目的字符串首地址以便返回
while (*dest++);
dest--;
while (*dest++ = *src++);
return ret;
}
int main()
{
char dest[100] = "hello";
char src[] = "world";
strcat(dest, src);
cout << dest << endl;
system("pause");
return 0;
}
C实现库函数strcat
最新推荐文章于 2020-12-31 16:17:31 发布