十年网站开发经验 + 多家企业客户 + 靠谱的建站团队
量身定制 + 运营维护+专业推广+无忧售后,网站问题一站解决
#include
#include
#include
void mystrcat(char *arr1, char *arr2,int leng)
{
int i=1,m=0,length=0;
while(i)
{
if (*(arr1 + m) != '\0')
{
length++;
m++;
continue;
}
i = 0;
}
for (i = length, m = 0; i <= length + leng; m++, i++)
{
*(arr1 + i) = *(arr2 + m);
}
}
int main()
{
char arr1[10] = "abcd";
char *arr2 = "efghh";
int leng = strlen(arr2);
mystrcat(arr1, arr2,leng);
printf("%s", arr1);
system("pause");
return 0;
}