1 #include <stdio.h> 2 #include <string.h> 3 #define N 5 4 5 6 char *mycpy(char *s1, char *s2) 7 { 8 //数组型 9 /* int i; 10 while(s2[i] != ' ') { 11 s1[i] = s2[i]; 12 i++; 13 } 14 s1[i] = ' '; 15 return s1; */ 16 //指针型 17 char *p = s1; 18 while(*s2 != '