XINU
lib
strncmp.c
Go to the documentation of this file.
1
13
int
strncmp
(
char
*s1,
char
*s2,
int
n)
14
{
15
16
while
(--n >= 0 && *s1 == *s2++)
17
{
18
if
(*s1++ ==
'\0'
)
19
{
20
return
0;
21
}
22
}
23
return
(n < 0 ? 0 : *s1 - *--s2);
24
}
strncmp
int strncmp(char *s1, char *s2, int n)
二つの文字列を最大N byteまで比較し、その結果を返す。
Definition:
strncmp.c:13
Generated by
1.8.13