mirror of
https://github.com/Ladebeze66/libft.git
synced 2025-12-13 04:36:55 +01:00
33 lines
1.1 KiB
C
Executable File
33 lines
1.1 KiB
C
Executable File
/* ************************************************************************** */
|
|
/* */
|
|
/* ::: :::::::: */
|
|
/* ft_strchr.c :+: :+: :+: */
|
|
/* +:+ +:+ +:+ */
|
|
/* By: fgras-ca <marvin@42.fr> +#+ +:+ +#+ */
|
|
/* +#+#+#+#+#+ +#+ */
|
|
/* Created: 2023/02/09 14:27:10 by fgras-ca #+# #+# */
|
|
/* Updated: 2023/02/21 10:54:39 by fgras-ca ### ########.fr */
|
|
/* */
|
|
/* ************************************************************************** */
|
|
|
|
#include "libft.h"
|
|
|
|
char *ft_strchr(const char *s, int c)
|
|
|
|
{
|
|
int i;
|
|
char *str;
|
|
|
|
str = (char *)s;
|
|
i = 0;
|
|
while (str[i])
|
|
{
|
|
if (str[i] == (char)c)
|
|
return (&str[i]);
|
|
i++;
|
|
}
|
|
if (str[i] == (char)c)
|
|
return (&str[i]);
|
|
return (0);
|
|
}
|