forked from josanri/Libft_extended
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_strlen.c
32 lines (29 loc) · 1.19 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: aalvarez <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/08/16 19:00:30 by aalvarez #+# #+# */
/* Updated: 2022/08/17 23:30:48 by aalvarez ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
/**
* @brief takes a string and returns its size (without counting
* the final NULL byte).
*
* @param str the string to be counted.
* @return size_t the size of the string.
*/
size_t ft_strlen(const char *str)
{
size_t i;
if (!str)
return (0);
i = 0;
while (str[i])
i++;
return (i);
}