1
0

first commit

This commit is contained in:
Adam Joly
2023-08-03 23:16:27 +02:00
parent 7f3254f1c5
commit a80c4d61d7
133 changed files with 4293 additions and 0 deletions

View File

@ -0,0 +1,36 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strstr.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: adjoly <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/07/18 21:31:36 by adjoly #+# #+# */
/* Updated: 2023/07/20 22:14:23 by adjoly ### ########.fr */
/* */
/* ************************************************************************** */
char *ft_strstr(char *str, char *to_find)
{
int i;
int j;
i = 0;
j = 0;
if (to_find[0] == '\0')
{
return (str);
}
while (str[i])
{
while (str[i + j] == to_find[j])
{
if (to_find[j + 1] == '\0')
return (&str[i]);
j++;
}
j = 0;
i++;
}
return (0);
}