-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_strlen.c
29 lines (26 loc) · 1.29 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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strlen.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: oadewumi <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/10/27 12:30:44 by oadewumi #+# #+# */
/* Updated: 2023/12/13 11:40:39 by oadewumi ### ########.fr */
/* */
/* ************************************************************************** */
/* This function counts the number of characters
pointed to by the string 'str' and returns an integer value 'count'*/
/* Modification on the variable type was done from 'char' to 'const char'.
This is in line with the manual prototype. */
/* This function imitates the standard C libraray function 'strlen'*/
int ft_strlen(const char *str)
{
int count;
count = 0;
while (str[count] != '\0')
{
count++;
}
return (count);
}