aboutsummaryrefslogtreecommitdiff
path: root/lib/libft/ft_strcmp.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libft/ft_strcmp.c')
-rw-r--r--lib/libft/ft_strcmp.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/lib/libft/ft_strcmp.c b/lib/libft/ft_strcmp.c
new file mode 100644
index 0000000..a319c63
--- /dev/null
+++ b/lib/libft/ft_strcmp.c
@@ -0,0 +1,23 @@
+/* ************************************************************************** */
+/* */
+/* ::: :::::::: */
+/* ft_strcmp.c :+: :+: :+: */
+/* +:+ +:+ +:+ */
+/* By: chuhlig <chuhlig@student.42.fr> +#+ +:+ +#+ */
+/* +#+#+#+#+#+ +#+ */
+/* Created: 2024/12/18 19:03:14 by chuhlig #+# #+# */
+/* Updated: 2025/01/14 14:09:59 by chuhlig ### ########.fr */
+/* */
+/* ************************************************************************** */
+
+#include "libft.h"
+
+int ft_strcmp(char *s1, char *s2)
+{
+ int i;
+
+ i = 0;
+ while (s1[i] && s1[i] == s2[i])
+ i++;
+ return (s1[i] - s2[i]);
+}