0
0
This commit is contained in:
Guy Baconniere
2021-08-18 13:05:29 +02:00
parent 74e3cc8eb8
commit df07d7f9f7
21 changed files with 141 additions and 53 deletions

View File

@@ -0,0 +1,27 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strncmp.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: dgloriod <marvin@42lausanne.ch> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/08/09 11:32:49 by dgloriod #+# #+# */
/* Updated: 2021/08/18 11:44:44 by gbaconni ### ########.fr */
/* */
/* ************************************************************************** */
int ft_strncmp(char *s1, char *s2, unsigned int n)
{
unsigned int i;
i = 0;
while (i < n)
{
if (s1[i] > s2[i])
return (1);
else if (s1[i] < s2[i])
return (-1);
i++;
}
return (0);
}