XINU
lib
strcmp.c
Go to the documentation of this file.
1
12
int
strcmp
(
13
char
*str1,
14
char
*str2)
15
{
16
while
(*str1 == *str2)
17
{
18
if
(*str1 ==
'\0'
)
19
{
20
return
0;
21
}
22
str1++;
23
str2++;
24
}
25
if
(*str1 < *str2)
26
{
27
return
-1;
28
}
29
else
30
{
31
return
1;
32
}
33
}
strcmp
int strcmp(char *str1, char *str2)
二つの文字列を比較し、その結果を返す。
Definition:
strcmp.c:12
Generated by
1.8.13