-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_strcmp.c
25 lines (23 loc) · 1.09 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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strcmp.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: anarodri <anarodri@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/11/02 15:56:26 by anarodri #+# #+# */
/* Updated: 2022/12/15 12:51:09 by anarodri ### ########.fr */
/* */
/* ************************************************************************** */
#include "../libft.h"
int ft_strcmp(const char *str1, const char *str2)
{
while (*str1 && *str2)
{
if (*str1 != *str2)
return ((unsigned char) *str1 - (unsigned char) *str2);
str1++;
str2++;
}
return (0);
}