-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_strlen.c
32 lines (29 loc) · 1.22 KB
/
ft_strlen.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strlen.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: mmaurer <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/08/25 13:44:54 by mmaurer #+# #+# */
/* Updated: 2021/09/01 23:25:19 by mmaurer ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
/*
* The strlen() function calculates the length of the string pointed to by s,
* excluding the terminating null byte ('\0').
* RETURN: The strlen() function returns the number of bytes in the string
* pointed to by s.
*/
size_t ft_strlen(const char *s)
{
size_t len;
len = 0;
while (*s != '\0')
{
s++;
len++;
}
return (len);
}