skeletton untested project
This commit is contained in:
commit
6fc620e8f4
187 changed files with 6584 additions and 0 deletions
28
libft/ft_strnonchr.c
Executable file
28
libft/ft_strnonchr.c
Executable file
|
|
@ -0,0 +1,28 @@
|
|||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* ft_strnonchr.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: thrieg <thrieg@student.42mulhouse.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/10/22 18:39:17 by thrieg #+# #+# */
|
||||
/* Updated: 2025/02/16 19:04:56 by thrieg ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "libft.h"
|
||||
|
||||
//returns the index of the first character that ISN'T c
|
||||
// /!\SEGFAULT if str is NULL
|
||||
//returns 0 if c is \0
|
||||
size_t ft_strnonchr(char *str, char c)
|
||||
{
|
||||
size_t i;
|
||||
|
||||
i = 0;
|
||||
if (c == '\0')
|
||||
return (0);
|
||||
while (str[i] == c)
|
||||
i++;
|
||||
return (i);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue