mirror of
https://github.com/guezoloic/libft.git
synced 2026-01-25 04:34:14 +00:00
feat: add ft_strlen function
This commit is contained in:
11
ft_strlen.c
Normal file
11
ft_strlen.c
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
#include "libft.h"
|
||||||
|
|
||||||
|
size_t strlen(const char *s)
|
||||||
|
{
|
||||||
|
size_t i;
|
||||||
|
|
||||||
|
i = 0;
|
||||||
|
while (s[i] != '\0')
|
||||||
|
i++;
|
||||||
|
return (i);
|
||||||
|
}
|
||||||
10
libft.h
10
libft.h
@@ -1,6 +1,8 @@
|
|||||||
#ifndef LIBFT_A
|
#ifndef LIBFT_A
|
||||||
#define LIBFT_A
|
#define LIBFT_A
|
||||||
|
|
||||||
|
# include <stdlib.h>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
The ft_isalpha() function tests for
|
The ft_isalpha() function tests for
|
||||||
any character for which isupper(3) or
|
any character for which isupper(3) or
|
||||||
@@ -39,4 +41,10 @@ int ft_isascii(int c);
|
|||||||
*/
|
*/
|
||||||
int ft_isprint(int c);
|
int ft_isprint(int c);
|
||||||
|
|
||||||
#endif
|
/*
|
||||||
|
The strlen() function computes the
|
||||||
|
length of the string s.
|
||||||
|
*/
|
||||||
|
size_t strlen(const char *s);
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user