stract,头文件中的函数,用于将两个char类型数组相连,结果放在dest中,并返回拼接后的dest和src。。
stract,头文件中的函数,用于将两个char类型数组相连,结果放在dest中,并返回拼接后的dest和src。。
stract(char* dest,const char* src);
将两个char类型数组相连,结果放在dest中,并返回拼接后的dest和src。
#include <stdio.h>
#include<stdlib.h>
char* Strcat(char *arr1,char *arr2)
{
char* tempt = arr1;
while(*arr1!='0')
{
arr1++;
}
while(*arr2!='0')
{
*arr1 = *arr2;
arr1++;
arr2++;
}
*arr1 = '0';
return tempt;
}
int main()
{
char a = "hello";
char b = ",everyOne!";
printf("%s",Strcat(a,b));
system("pause");
return 0;
}