-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_strlen.c
39 lines (34 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
30
31
32
33
34
35
36
37
38
39
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strlen.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: mgraf <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/11/28 11:41:29 by mgraf #+# #+# */
/* Updated: 2022/11/30 16:07:05 by mgraf ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
/**
* @brief Calculates the length of a null-terminated string.
*
* @param str The string to calculate the length of.
*
* @return The length of the string.
*/
size_t ft_strlen(const char *str)
{
size_t length;
length = 0;
while (str[length] != '\0')
length++;
return (length);
}
/* int main(void)
{
char *string = "ABC";
ft_strlen(string);
//printf("%i", ft_strlen(string));
return 0;
} */