skeletton untested project
This commit is contained in:
commit
6fc620e8f4
187 changed files with 6584 additions and 0 deletions
26
libft/ft_strncmp.c
Executable file
26
libft/ft_strncmp.c
Executable file
|
|
@ -0,0 +1,26 @@
|
|||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* ft_strncmp.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: thrieg <thrieg@student.42mulhouse.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/10/14 17:12:52 by thrieg #+# #+# */
|
||||
/* Updated: 2025/02/16 19:04:55 by thrieg ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "libft.h"
|
||||
|
||||
int ft_strncmp(const char *s1, const char *s2, size_t n)
|
||||
{
|
||||
while (n && *s1 && (*s1 == *s2))
|
||||
{
|
||||
s1++;
|
||||
s2++;
|
||||
n--;
|
||||
}
|
||||
if (n == 0)
|
||||
return (0);
|
||||
return ((const unsigned char)*s1 - (const unsigned char)*s2);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue