45 lines
1.2 KiB
C
45 lines
1.2 KiB
C
/* ************************************************************************** */
|
|
/* */
|
|
/* ::: :::::::: */
|
|
/* ft_strlib.c :+: :+: :+: */
|
|
/* +:+ +:+ +:+ */
|
|
/* By: tischmid <marvin@42.fr> +#+ +:+ +#+ */
|
|
/* +#+#+#+#+#+ +#+ */
|
|
/* Created: 2023/04/01 07:13:31 by tischmid #+# #+# */
|
|
/* Updated: 2023/04/01 21:55:16 by tischmid ### ########.fr */
|
|
/* */
|
|
/* ************************************************************************** */
|
|
|
|
#include "ft_strlib.h"
|
|
|
|
int ft_strcmp(char *s1, char *s2)
|
|
{
|
|
while (*s1 && *s2 && *s1 == *s2)
|
|
{
|
|
++s1;
|
|
++s2;
|
|
}
|
|
return (*s1 - *s2);
|
|
}
|
|
|
|
char *ft_strcpy(char *dest, char *src)
|
|
{
|
|
char *o_dest;
|
|
|
|
o_dest = dest;
|
|
while (*src)
|
|
*dest++ = *src++;
|
|
*dest = 0;
|
|
return (o_dest);
|
|
}
|
|
|
|
int ft_strlen(char *str)
|
|
{
|
|
int i;
|
|
|
|
i = 0;
|
|
while (*str++)
|
|
++i;
|
|
return (i);
|
|
}
|