-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathft_strlen.c
More file actions
31 lines (27 loc) · 1.13 KB
/
ft_strlen.c
File metadata and controls
31 lines (27 loc) · 1.13 KB
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
/* ************************************************************************** */
/* */
/* :::::::: */
/* ft_strlen.c :+: :+: */
/* +:+ */
/* By: farodrig <farodrig@student.codam.nl> +#+ */
/* +#+ */
/* Created: 2020/11/27 11:18:24 by farodrig #+# #+# */
/* Updated: 2021/02/28 20:46:08 by farodrig ######## odam.nl */
/* */
/* ************************************************************************** */
#include "libft.h"
/*
** Calculates the length of the string pointed to by s, excluding the
** terminating null byte.
*/
size_t ft_strlen(const char *str)
{
size_t counter;
counter = 0;
while (*str != '\0')
{
str++;
counter++;
}
return (counter);
}