1 //子实现字符串的拼接 2 //2017.3.7 3 4 #include <stdio.h> 5 #include <stdlib.h> 6 void strcat(char *p1, char *p2,int n1,int n2); 7 int main() 8 { 9 char str1[100] = "dfdfdfdf"; 10 char str2[200] = "abcdfe"; 11 char *p1 = str1; 12 char *p2 = str2; 13 int n1 = 0; 14 int n2 = 0; 15 16 strcat(p1, p2,n1,n2); 17 printf("拼接完成后的字符串为%s ", str1); 18 system("pause"); 19 return 1; 20 } 21 22 void strcat(char *p1, char *p2, int n1, int n2) 23 { 24 int i = 0; 25 while (*p1 != '