The_Law

Untitled

Sep 24th, 2018
358
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.42 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.         if (isspace(*str1)) {
  8.             ++str1;
  9.         } else if (isspace(*str2)) {
  10.             ++str2;
  11.         } else if (*str1 == *str2) {
  12.             ++str1;
  13.             ++str2;
  14.         }
  15.     }
  16.  
  17.     return (unsigned char) *str1 - (unsigned char) *str2;
  18. }
Advertisement
Add Comment
Please, Sign In to add comment