Write your own strcat function ------ → mycmp
1 # include <stdio. h> 2 # include <string. h> 3 # define N 5 4 5 Int mycmp (char * S1, char * S2) 6 {7 // array type 8/* int I = 0; 9 While (S1 [I] = S2 [I] & S1 [I]! = '\ 0') {10 I ++; 11} 12 13 return S1 [I]-S2 [I]; */14 // pointer type 15 while (* S1 = * S2 & * S1! = '\ 0') {16 S1 ++; 17 S2 ++; 18} 19 20 return * S1-* S2; 21} 22 23 int main () 24 {25 char S1 [100]; 26 char S2 [100]; 27 // gets (S1); 28 // gets (S2); 29 fgets (S1, n, stdin); 30 if (S1 [strlen (S1)-1] = '\ n') {// remove linefeed 31 S1 [strlen (S1) -1] = '\ 0'; 32} 33 fflush (stdin); // clear the buffer (for details, see the difference between gets and fgets) 34 fgets (S2, n, stdin); 35 if (s2 [strlen (S2)-1] = '\ n') {// remove linefeed 36 S2 [strlen (S2) -1] = '\ 0'; 37} 38 printf ("% d", mycmp (S1, S2); 39 40 return 0; 41}