-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_strcmp.c
28 lines (25 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
24
25
26
27
28
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strcmp.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: rblondia <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/11/03 11:23:01 by rblondia #+# #+# */
/* Updated: 2021/12/05 17:51:54 by rblondia ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
int ft_strcmp(const char *a, const char *b)
{
int i;
if (!a || !b || ft_strlen(a) != ft_strlen(b))
return (0);
i = -1;
while (a[++i])
{
if (a[i] != b[i])
return (0);
}
return (1);
}