Guest User

Untitled

a guest
Oct 18th, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.35 KB | None | 0 0
  1. int strcmpx(unsigned char s1[], unsigned char s2[])
  2. {
  3.     int i;
  4.  
  5.     for (i = 0; ; i++) {
  6.         if ((i >= strlen(s1)) && i < strlen(s2)) return -1;
  7.         if ((i >= strlen(s2)) && i < strlen(s1)) return 1;
  8.         if ((i >= strlen(s2)) && i >= strlen(s1)) return 0;
  9.  
  10.         if (s1[i] - s2[i] != 0) return s1[i] - s2[i];
  11.     }
  12.     return 0;
  13. }
Add Comment
Please, Sign In to add comment