Archived
1
0

wip_parsing

This commit is contained in:
Maelys
2024-09-10 16:27:06 +02:00
commit c671539661
62 changed files with 1863 additions and 0 deletions

31
libft/mem/ft_memcmp.c Normal file
View File

@ -0,0 +1,31 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_memcmp.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: madumerg <madumerg@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/10/31 14:42:37 by madumerg #+# #+# */
/* Updated: 2023/11/02 14:11:43 by madumerg ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
int ft_memcmp(const void *s1, const void *s2, size_t n)
{
size_t i;
unsigned char *ptr1;
unsigned char *ptr2;
ptr1 = (unsigned char *) s1;
ptr2 = (unsigned char *) s2;
i = 0;
while (i < n)
{
if (ptr1[i] != ptr2[i])
return (ptr1[i] - ptr2[i]);
i++;
}
return (0);
}