Libft
42 Libft library documentation
Loading...
Searching...
No Matches
ft_strlen.c File Reference
#include <stdlib.h>
+ Include dependency graph for ft_strlen.c:

Go to the source code of this file.

Functions

size_t ft_strlen (const char *str)
 Returns the length of a null-terminated string.
 

Function Documentation

◆ ft_strlen()

size_t ft_strlen ( const char *  str)

Returns the length of a null-terminated string.

Parameters
strInput string.
Returns
Number of characters before the terminating null byte.

Definition at line 21 of file ft_strlen.c.

22{
23 const char *s;
24
25 s = str;
26 while (*s)
27 s++;
28 return (s - str);
29}

Referenced by ft_putstr_fd(), ft_strdup(), ft_strjoin(), ft_strlcat(), ft_strlcpy(), ft_strmapi(), ft_strrchr(), ft_strtrim(), and ft_substr().

+ Here is the caller graph for this function: