/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ft_memcmp.c :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: gantonio +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2021/05/18 17:52:27 by gantonio #+# #+# */ /* Updated: 2021/05/31 19:28:42 by gantonio ### ########.fr */ /* */ /* ************************************************************************** */ #include "libft.h" int ft_memcmp(const void *str1, const void *str2, size_t len) { size_t i; i = 0; while (i < len) { if (((unsigned char *)str1)[i] != ((unsigned char *)str2)[i]) return (((unsigned char *)str1)[i] - ((unsigned char *)str2)[i]); i++; } return (0); }