Files
Arquivotheca.SunOS-4.1.4/games/monop/strcmp.c
seta75D ff309bfe1c Init
2021-10-11 18:37:13 -03:00

25 lines
420 B
C

#ifndef lint
static char sccsid[] = "@(#)strcmp.c 1.1 94/10/31 SMI"; /* from UCB */
#endif
# include <stdio.h>
# include <ctype.h>
# define reg register
# define makelower(c) (isupper(c) ? tolower(c) : c)
/*
* Compare strings: s1>s2: >0 s1==s2: 0 s1<s2: <0
*/
strcmp(s1, s2)
reg char *s1, *s2; {
while (makelower(*s1) == makelower(*s2)) {
if (*s1 == '\0')
return 0;
s1++, s2++;
}
return *s1 - *s2;
}