-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_strcmp.c
23 lines (20 loc) · 1.08 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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strcmp.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: lenzo-pe <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/02/04 16:12:52 by lenzo-pe #+# #+# */
/* Updated: 2021/05/07 14:54:44 by lenzo-pe ### ########.fr */
/* */
/* ************************************************************************** */
#include "ft_string.h"
int ft_strcmp(const char *str1, const char *str2)
{
int i;
i = 0;
while (str1[i] == str2[i] && str1[i] && str2[i])
i++;
return ((unsigned char)str1[i] - (unsigned char)str2[i]);
}