Guest User

Untitled

a guest
Nov 24th, 2017
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.25 KB | None | 0 0
  1. int memcmp(const void *s1, const void *s2, size_t n) {
  2.   if (n != 0) {
  3.     const unsigned char *p1 = s1, *p2 = s2;
  4.    
  5.     do {
  6.       if (*p1++ != *p2++) {
  7.         return (*--p1 - *--p2);
  8.       }
  9.     } while (--n != 0);
  10.   }
  11.   return (0);
  12. }
Add Comment
Please, Sign In to add comment