/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ft_strcmp.c :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: tischmid +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2023/03/17 18:25:06 by tischmid #+# #+# */ /* Updated: 2023/03/28 18:55:35 by tischmid ### ########.fr */ /* */ /* ************************************************************************** */ int ft_strcmp(char *s1, char *s2) { while (*s1 && *s2 && *s1 == *s2) { ++s1; ++s2; } return (*s1 - *s2); } /* //// #include #define STR1 "hellb" #define STR2 "hello" int main(void) { int result; printf("'%s' VS '%s'\n", STR1, STR2); result = ft_strcmp(STR1, STR2); if(!result) printf("Strings are the same (0)\n"); else printf("Strings are different (offset=%d)\n", result); return (0); } */ ////