C语言strcat的实现
#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;
}
网页标题:C语言strcat的实现
分享路径:http://azwzsj.com/article/ihhjsd.html