adding the flags

This commit is contained in:
Maoake Teriierooiterai
2026-01-07 13:13:30 +01:00
parent 0d9b46c748
commit 93e8c10b27
8 changed files with 134 additions and 1 deletions

25
parsing/ft_strncmp.c Normal file
View File

@@ -0,0 +1,25 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strncmp.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: mteriier <mteriier@student.42lyon.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2026/01/07 12:36:38 by mteriier #+# #+# */
/* Updated: 2026/01/07 12:36:40 by mteriier ### ########lyon.fr */
/* */
/* ************************************************************************** */
int ft_strncmp(const char *s1, const char *s2, int n)
{
int i;
i = 0;
if (n == 0)
return (0);
while (i < n - 1 && s1[i] && s1[i] == s2[i])
{
i++;
}
return ((unsigned char)s1[i] - (unsigned char)s2[i]);
}