[C库函数]strcat实现
[cpp]#include <iostream>
#include <assert.h>
using namespace std;
char *strcat_bxy(char *dst, const char *src)
{
assert(dst != NULL && src != NULL);
char *tmp = dst;
while(*dst != NULL)
{
dst++;
}
while(*dst++ = *src++);
return tmp;
}
void main()
{
char a[100] = "bxy";
char *b = "123";
strcat_bxy(a,b);
cout << a <<endl;
}
补充:软件开发 , C语言 ,