-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathft_strcmp.c
21 lines (20 loc) · 1.04 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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strcmp.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: akassil <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2017/07/03 16:50:11 by akassil #+# #+# */
/* Updated: 2018/05/01 01:11:19 by akassil ### ########.fr */
/* */
/* ************************************************************************** */
int ft_strcmp(char *s1, char *s2)
{
while (*s1 == *s2 && (*s1 != '\0') && (*s2 != '\0'))
{
s1++;
s2++;
}
return (int)((unsigned char)*s1 - (unsigned char)*s2);
}