The_Law

Untitled

Sep 24th, 2018
357
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.50 KB | None | 0 0
  1. #include <ctype.h>
  2.  
  3. int
  4. mystrspccmp(const char *str1, const char *str2)
  5. {
  6.     while (isspace(*str1) || isspace(*str2) || (*str1 != 0 && *str2 != 0)) {
  7.         while (isspace(*str1)) {
  8.             ++str1;
  9.         }
  10.         while (isspace(*str2)) {
  11.             ++str2;
  12.         }
  13.         if (*str1 != 0 && *str2 != 0 && *str1 == *str2) {
  14.             ++str1;
  15.             ++str2;
  16.         } else {
  17.             break;
  18.         }
  19.     }
  20.  
  21.     return (unsigned char) *str1 - (unsigned char) *str2;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment