#include<stdio.h>
#include<stdlib.h>
#include<assert.h>
char *my_strcat(char* arr1, char* arr2){
char* arr3 = arr1;
assert(arr1);
assert(arr2);
while (*arr1){
arr1++;
}
while (*arr1++ = *arr2++){
;
}
printf("%s\n", arr3);
return arr3;
}
int main(){
char arr1[100] = "abcd";
char arr2[] = "efg";
my_strcat(arr1, arr2);
system("pause");
return 0;
}
模拟实现strcat
最新推荐文章于 2024-04-21 16:27:54 发布