home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The C Users' Group Library 1994 August
/
wc-cdrom-cusersgrouplibrary-1994-08.iso
/
listings
/
v_10_11
/
1011012c
< prev
next >
Wrap
Text File
|
1992-09-03
|
281b
|
13 lines
/* strcmp function */
#include <string.h>
int (strcmp)(const char *s1, const char *s2)
{ /* compare unsigned char s1[], s2[] */
for (; *s1 == *s2; ++s1, ++s2)
if (*s1 == '\0')
return (0);
return ((*(unsigned char *)s1
< *(unsigned char *)s2) ? -1 : +1);
}