;***
;int strncmp(first, last, count) - compare first count chars of strings
;
;Purpose:
;       Compares two strings for lexical order.  The comparison stops
;       after: (1) a difference between the strings is found, (2) the end
;       of the strings is reached, or (3) count characters have been
;       compared.
;
;       Algorithm:
;       int
;       strncmp (first, last, count)
;             char *first, *last;
;             unsigned count;
;             {
;             if (!count)
;                     return(0);
;             while (--count && *first && *first == *last)
;                     {
;                     first++;
;                     last++;
;                     }
;             return(*first - *last);
;             }
;
;Entry:
;       char *first, *last - strings to compare
;       unsigned count - maximum number of characters to compare
;
;Exit:
;       returns <0 if first < last
;       returns 0 if first == last
;       returns >0 if first > last
;
;Uses:
;
;Exceptions:
;
;*******************************************************************************

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-13
  • 2022-01-18
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-01-12
  • 2021-07-29
  • 2022-12-23
  • 2021-09-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案