Archived
first commit
This commit is contained in:
1 parent
1fe062c970
commit
eb6b113e51
125 files changed
+2987
No files matched your search
@@ -0,0 +1,27 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* ft_strncmp.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: ajoly <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2022/07/21 10:14:08 by ajoly #+# #+# */
|
||||
/* Updated: 2022/07/21 10:14:11 by ajoly ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
int ft_strncmp(char *s1, char *s2, unsigned int n)
|
||||
{
|
||||
unsigned int i;
|
||||
|
||||
i = 0;
|
||||
if (n == 0)
|
||||
{
|
||||
return (0);
|
||||
}
|
||||
while (s1[i] == s2[i] && i + 1 < n && s1[i] != '\0' && s2[i] != '\0')
|
||||
{
|
||||
i++;
|
||||
}
|
||||
return (s1[i] - s2[i]);
|
||||
}
|
||||
Reference in new issue
Block a user