-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_strcmp.c
29 lines (27 loc) · 1.14 KB
/
ft_strcmp.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strcmp.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: vportell <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2013/08/15 20:24:40 by schapuis #+# #+# */
/* Updated: 2016/10/31 08:46:48 by vportell ### ########.fr */
/* */
/* ************************************************************************** */
int ft_strcmp(const char *s1, const char *s2)
{
int i;
unsigned char *s11;
unsigned char *s12;
s11 = (unsigned char *)s1;
s12 = (unsigned char *)s2;
i = 0;
while (s11[i] || s12[i])
{
if (s11[i] != s12[i])
return (s11[i] - s12[i]);
i++;
}
return (0);
}