-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathft_strlen.c
36 lines (32 loc) · 1.27 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
33
34
35
36
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strlen.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: cjackows <cjackows@student.42wolfsburg. +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/06/08 22:36:13 by cjackows #+# #+# */
/* Updated: 2022/06/19 15:55:19 by cjackows ### ########.fr */
/* */
/* ************************************************************************** */
#include "../inc/libft.h"
/**
* @brief Function determines the length of string excluding the ending
* null character.
* @param s Given string.
* @return Returns size_t the length of string.
*/
size_t ft_strlen(const char *s)
{
size_t i;
i = 0;
while (s[i])
i++;
return (i);
}
// int main(void)
// {
// const char s[] = "Hello World!";
// printf("%ld\n", ft_strlen(s));
// return (0);
// }