写自己的strcat函数------→mycat
1 #include <stdio.h> 2 #include <string.h> 3 #define N 5 4 5 char *mycat(char *s1, char *s2) 6 { 7 //数组型 8 /* int i = 0; 9 while(s1[i] != ' ') { 10 i++; 11 } 12 int j = 0; 13 while(s2[j] != ' ') { 14 s1[i] = s2[j]; 15 i++; 16 j++; 17 } 18 s1[i] = ' '; 19 20 return s1; */ 21 //指针型 22 char *p = s1; //定义字符型指针p指向s1 23 while(*s1 != '