home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / INFO / C / JPLC2.ZIP / STRCMP.C < prev    next >
Encoding:
C/C++ Source or Header  |  1988-07-22  |  696 b   |  23 lines

  1. /* 1.0  07-06-84 */
  2. /************************************************************************
  3.  *            Robert C. Tausworthe                *
  4.  *            Jet Propulsion Laboratory            *
  5.  *            Pasadena, CA 91009        1984        *
  6.  ************************************************************************/
  7.  
  8. #include "defs.h"
  9. #include "stdtyp.h"
  10.  
  11. /************************************************************************/
  12.  
  13. strcmp(s, t)    /* return 0 if strings s and t are the same, a neg no. if
  14.            s < t, and a pos. no. if s > t.            */
  15. /*----------------------------------------------------------------------*/
  16. STRING s, t;
  17. {
  18.     for ( ; *s IS *t; s++, t++)
  19.         if (*s IS NULL)
  20.             return (NULL);
  21.     return (*s - *t);
  22. }
  23.