first commit
This commit is contained in:
23
ended/C03/ex00/ft_strcmp.c
Normal file
23
ended/C03/ex00/ft_strcmp.c
Normal file
@ -0,0 +1,23 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* ft_strcmp.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: ajoly <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2022/07/20 16:55:23 by ajoly #+# #+# */
|
||||
/* Updated: 2022/07/20 16:55:30 by ajoly ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
int ft_strcmp(char *s1, char *s2)
|
||||
{
|
||||
int i;
|
||||
|
||||
i = 0;
|
||||
while (s1[i] == s2[i] && s1[i] != '\0' && s2[i] != '\0')
|
||||
{
|
||||
i++;
|
||||
}
|
||||
return (s1[i] - s2[i]);
|
||||
}
|
Reference in New Issue
Block a user