-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathft_strcmp.c
More file actions
21 lines (20 loc) · 1.03 KB
/
ft_strcmp.c
File metadata and controls
21 lines (20 loc) · 1.03 KB
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: rlambert <rlambert@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2014/11/04 15:23:46 by rlambert #+# #+# */
/* Updated: 2015/01/02 15:33:33 by rlambert ### ########.fr */
/* */
/* ************************************************************************** */
int ft_strcmp(const char *s1, const char *s2)
{
while (*s1 != '\0' && *s1 == *s2)
{
s1++;
s2++;
}
return ((unsigned char)*s1 - (unsigned char)*s2);
}